jenkins-bot has submitted this change and it was merged.
Change subject: Attach VE toolbar after VE debug bar, if there is one
......................................................................
Attach VE toolbar after VE debug bar, if there is one
The surface attaches the debug bar after itself, but the
toolbar is also attached after the surface, so whether
the debug bar ends up being before or after the toolbar in
the DOM depends on which was attached first.
We want the debug bar to be before the toolbar for correct
styling, and right now that works by accident. But if
we reuse a target (by removing a surface and then adding
a new one later), the operations will run in a different
order the second time and the debug bar will end up
after the toolbar.
Really ve.ui.Surface shouldn't append things after itself
(but instead but the debug bar inside itself), but until
that (T106927) is fixed, let's explicitly put the toolbar
after the debug bar.
Bug: T103712
Change-Id: I0a36126eafe35575d228b4011524b06789716ff5
---
M modules/editor/editors/visualeditor/mw.flow.ve.Target.js
1 file changed, 6 insertions(+), 1 deletion(-)
Approvals:
Matthias Mullie: Looks good to me, approved
jenkins-bot: Verified
diff --git a/modules/editor/editors/visualeditor/mw.flow.ve.Target.js
b/modules/editor/editors/visualeditor/mw.flow.ve.Target.js
index 7066f2e..140cb4b 100644
--- a/modules/editor/editors/visualeditor/mw.flow.ve.Target.js
+++ b/modules/editor/editors/visualeditor/mw.flow.ve.Target.js
@@ -47,7 +47,12 @@
// Methods
mw.flow.ve.Target.prototype.attachToolbar = function () {
- this.getToolbar().$element.insertAfter(
this.getToolbar().getSurface().$element );
+ // HACK ve.ui.Surface appends a debugBar *after* itself instead
of putting it
+ // inside itself (T106927)
+ // Work around this by appending the toolbar after the debugBar
if it's there, and
+ // after the surface otherwise.
+ var surface = this.getToolbar().getSurface();
+ ( surface.debugBar || surface ).$element.after(
this.getToolbar().$element );
};
}( mediaWiki, OO, ve ) );
--
To view, visit https://gerrit.wikimedia.org/r/220530
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I0a36126eafe35575d228b4011524b06789716ff5
Gerrit-PatchSet: 3
Gerrit-Project: mediawiki/extensions/Flow
Gerrit-Branch: master
Gerrit-Owner: Mooeypoo <[email protected]>
Gerrit-Reviewer: Catrope <[email protected]>
Gerrit-Reviewer: Matthias Mullie <[email protected]>
Gerrit-Reviewer: Mooeypoo <[email protected]>
Gerrit-Reviewer: jenkins-bot <>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits