mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-04-17 15:51:52 -04:00
Fix bugs around operations happening between modes
The `release` method is meant to clean up a sticky element before removal from the store. The part of this that cleared CSS added due to being in dialog mode was only run if still in that mode. In the template folder JS, we set the mode before running `recalculate` so elements can be cleaned in a different mode to that they were last in. This meant some CSS wasn't being cleaned up. This sometimes caused an effect where elements that were added back to the DOM but not stuck would still have CSS used when they were last stuck. This commit also includes the addition of some missing code that adds back CSS to offset an element when in a dialog stack.
This commit is contained in:
@@ -576,9 +576,8 @@
|
||||
|
||||
el.removeStickyClasses(this);
|
||||
$el.css('width', '');
|
||||
if (_mode === 'dialog') {
|
||||
dialog.releaseEl(el, this);
|
||||
}
|
||||
// clear styles from any elements stuck while in a dialog mode
|
||||
dialog.releaseEl(el, this);
|
||||
el.removeShim();
|
||||
el.release(this);
|
||||
}
|
||||
@@ -658,9 +657,15 @@
|
||||
}
|
||||
};
|
||||
stickAtTop.unstop = function (el) {
|
||||
var offset = 0;
|
||||
|
||||
if (_mode === 'dialog') {
|
||||
offset = dialog.getOffsetFromEdge(el, this);
|
||||
}
|
||||
|
||||
el.$fixedEl.css({
|
||||
'position': '',
|
||||
'top': ''
|
||||
'top': offset + 'px'
|
||||
});
|
||||
el.unstop();
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user