mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-15 10:35:48 +00:00
Position toolbar if loading with non-zero scroll offset
The scroll event doesn't fire if the page is already scrolled when ve is loaded. Change-Id: I5b5a2dff2055d9ff1a8b2a2e0016a3fe7aaf22fb
This commit is contained in:
parent
10948ba91f
commit
bc04b08892
|
@ -245,6 +245,11 @@ ve.ui.Toolbar.prototype.resetPosition = function () {
|
|||
*/
|
||||
ve.ui.Toolbar.prototype.enableFloating = function () {
|
||||
this.$window = $( this.getElementWindow() ).on( this.windowEvents );
|
||||
// TODO: Place this is a DOM attach event for this.$
|
||||
setTimeout( ve.bind( function () {
|
||||
// The page may load with a non-zero scroll without trigger the scroll event
|
||||
this.onWindowScroll();
|
||||
}, this ), 0 );
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in a new issue