jenkins-bot has submitted this change and it was merged.
Change subject: Death to isolation
......................................................................
Death to isolation
Introduces ce.Surface#(de)activate which is called when
windows are opened/closed. Deactivate removes the native
selection, stops the surface observer and redirects all
showSelection calls to a fake selection renderer, allowing
the native selection to be placed in another window (e.g. an
inspector) without appearing to lose your document selection.
Removes the extra key listeners hack for target/document commands
now they aren't isolated.
Bonus: Fix getClientRectFromNode to work from an arbitrary range.
Previously it always used the current selection's range.
Change-Id: I55c55439f93f9780eda2014c5a5f46270129e609
---
M src/ce/styles/ve.ce.Surface.css
M src/ce/ve.ce.Surface.js
M src/ui/actions/ve.ui.WindowAction.js
M src/ui/dialogs/ve.ui.FindAndReplaceDialog.js
M src/ui/dialogs/ve.ui.ToolbarDialog.js
M src/ui/inspectors/ve.ui.FragmentInspector.js
M src/ui/styles/dialogs/ve.ui.FindAndReplaceDialog.css
M src/ui/styles/dialogs/ve.ui.ToolbarDialog.css
M src/ui/styles/inspectors/ve.ui.FragmentInspector.css
M src/ui/ve.ui.DesktopContext.js
M src/ui/ve.ui.MobileContext.js
M src/ui/ve.ui.MobileSurface.js
M src/ui/ve.ui.Surface.js
13 files changed, 192 insertions(+), 76 deletions(-)
Approvals:
Catrope: Looks good to me, approved
jenkins-bot: Verified
diff --git a/src/ce/styles/ve.ce.Surface.css b/src/ce/styles/ve.ce.Surface.css
index 5e8ea14..f90c93f 100644
--- a/src/ce/styles/ve.ce.Surface.css
+++ b/src/ce/styles/ve.ce.Surface.css
@@ -16,6 +16,28 @@
}
/* @noflip */
+.ve-ce-surface-deactivatedSelection {
+ position: absolute;
+ top: 0;
+ left: 0;
+ opacity: 0.5;
+ pointer-events: none;
+}
+
+.ve-ce-surface-deactivatedSelection > div {
+ position: absolute;
+ background: #6da9f7;
+ margin-top: -0.15em;
+ padding: 0.15em 0;
+}
+
+/* Set opacity directly on the highlights, rather than their containers,
+ otherwise the opacity isn't applied at all */
+.ve-init-target-ie .ve-ce-surface-deactivatedSelection > div {
+ opacity: 0.5;
+}
+
+/* @noflip */
.ve-ce-surface-highlights {
position: absolute;
top: 0;
diff --git a/src/ce/ve.ce.Surface.js b/src/ce/ve.ce.Surface.js
index 9bad070..88933b1 100644
--- a/src/ce/ve.ce.Surface.js
+++ b/src/ce/ve.ce.Surface.js
@@ -50,6 +50,8 @@
this.selecting = false;
this.resizing = false;
this.focused = false;
+ this.deactivated = false;
+ this.$deactivatedSelection = this.$( '<div>' );
this.activeTableNode = null;
this.contentBranchNodeChanged = false;
this.$highlightsFocused = this.$( '<div>' );
@@ -156,6 +158,7 @@
this.$highlights.addClass( 've-ce-surface-highlights' );
this.$highlightsFocused.addClass( 've-ce-surface-highlights-focused' );
this.$highlightsBlurred.addClass( 've-ce-surface-highlights-blurred' );
+ this.$deactivatedSelection.addClass(
've-ce-surface-deactivatedSelection' );
this.$pasteTarget.addClass( 've-ce-surface-paste' )
.attr( 'tabIndex', -1 )
.prop( 'contentEditable', 'true' );
@@ -163,6 +166,7 @@
// Add elements to the DOM
this.$element.append( this.$documentNode, this.$pasteTarget );
this.surface.$blockers.append( this.$highlights );
+ this.surface.$selections.append( this.$deactivatedSelection );
};
/* Inheritance */
@@ -289,7 +293,7 @@
this.$window.off( 'resize', this.onWindowResizeHandler );
// HACK: Blur to make selection/cursor disappear (needed in Firefox in
some cases)
- documentNode.$element[0].blur();
+ this.$documentNode[0].blur();
// Remove DOM elements (also disconnects their events)
this.$element.remove();
@@ -336,7 +340,7 @@
};
/**
- * Get a client rect from the selection's focused node
+ * Get a client rect from the range's end node
*
* This function is used internally by getSelectionRects and
* getSelectionBoundingRect as a fallback when Range.getClientRects
@@ -344,11 +348,12 @@
* locate the selection focus position.
*
* @private
+ * @param {Range} range Range to get client rect for
* @return {Object} ClientRect-like object
*/
-ve.ce.Surface.prototype.getClientRectFromNode = function () {
- var rect, side, x, range, adjacentNode, unicornRect,
- node = this.nativeSelection.focusNode;
+ve.ce.Surface.prototype.getNodeClientRectFromRange = function ( range ) {
+ var rect, side, x, adjacentNode, unicornRect,
+ node = range.endContainer;
while ( node && node.nodeType !== Node.ELEMENT_NODE ) {
node = node.parentNode;
@@ -370,7 +375,6 @@
}
side = this.getModel().getDocument().getDir() === 'rtl' ? 'right' :
'left';
- range = this.nativeSelection.getRangeAt( 0 );
adjacentNode = range.endContainer.childNodes[ range.endOffset ];
if ( range.collapsed && $( adjacentNode ).hasClass( 've-ce-unicorn' ) )
{
// We're next to a unicorn; use its left/right position
@@ -401,7 +405,7 @@
* @returns {Object[]|null} Selection rectangles
*/
ve.ce.Surface.prototype.getSelectionRects = function ( selection ) {
- var i, l, range, nativeRange, surfaceRect, focusedNode,
+ var i, l, range, nativeRange, surfaceRect, focusedNode, rect,
rects = [],
relativeRects = [];
@@ -431,7 +435,10 @@
throw new Error( 'getClientRects returned empty list' );
}
} catch ( e ) {
- rects = [ this.getClientRectFromNode() ];
+ rect = this.getNodeClientRectFromRange( nativeRange );
+ if ( rect ) {
+ rects = [ rect ];
+ }
}
surfaceRect = this.getSurface().getBoundingClientRect();
@@ -505,7 +512,7 @@
throw new Error( 'getBoundingClientRect returned null'
);
}
} catch ( e ) {
- boundingRect = this.getClientRectFromNode();
+ boundingRect = this.getNodeClientRectFromRange( nativeRange );
}
surfaceRect = this.getSurface().getBoundingClientRect();
@@ -576,7 +583,7 @@
// If we are calling focus after replacing a node the selection may be
gone
// but onDocumentFocus won't fire so restore the selection here too.
- this.onModelSelect( selection );
+ this.onModelSelect();
setTimeout( function () {
// In some browsers (e.g. Chrome) giving the document node
focus doesn't
// necessarily give you a selection (e.g. if the first child is
a <figure>)
@@ -621,11 +628,82 @@
true
);
- if ( hasFocus && !this.isFocused() ) {
- this.onDocumentFocus();
+ if ( this.deactivated ) {
+ if ( OO.ui.contains( this.$documentNode[0],
this.nativeSelection.anchorNode, true ) ) {
+ this.onDocumentFocus();
+ }
+ } else {
+ if ( hasFocus && !this.isFocused() ) {
+ this.onDocumentFocus();
+ }
+ if ( !hasFocus && this.isFocused() ) {
+ this.onDocumentBlur();
+ }
}
- if ( !hasFocus && this.isFocused() ) {
- this.onDocumentBlur();
+};
+
+/**
+ * Deactivate the surface, stopping the surface observer and replacing the
native
+ * range with a fake rendered one.
+ *
+ * Used by dialogs so they can take focus without losing the original document
selection.
+ */
+ve.ce.Surface.prototype.deactivate = function () {
+ if ( !this.deactivated ) {
+ // Disable the surface observer, there can be no observeable
changes
+ // until the surface is activated
+ this.surfaceObserver.disable();
+ this.deactivated = true;
+ // Remove ranges so the user can't accidentally type into the
document
+ this.nativeSelection.removeAllRanges();
+ this.updateDeactivatedSelection();
+ }
+};
+
+/**
+ * Reactivate the surface and restore the native selection
+ */
+ve.ce.Surface.prototype.activate = function () {
+ if ( this.deactivated ) {
+ this.deactivated = false;
+ this.updateDeactivatedSelection();
+ this.surfaceObserver.enable();
+ if ( OO.ui.contains( this.$documentNode[0],
this.nativeSelection.anchorNode, true ) ) {
+ // The selection has been placed back in the document,
either by the user clicking
+ // or by the closing window updating the model. Poll in
case it was the user clicking.
+ this.surfaceObserver.pollOnce();
+ } else {
+ // Clear focused node so onModelSelect re-selects it if
necessary
+ this.focusedNode = null;
+ this.onModelSelect();
+ }
+ }
+};
+
+/**
+ * Update the fake selection while the surface is deactivated.
+ *
+ * While the surface is deactivated, all calls to showSelection will get
redirected here.
+ */
+ve.ce.Surface.prototype.updateDeactivatedSelection = function () {
+ var i, l, rects,
+ selection = this.getModel().getSelection();
+
+ this.$deactivatedSelection.empty();
+
+ if ( !this.deactivated || this.focusedNode || !( selection instanceof
ve.dm.LinearSelection ) ) {
+ return;
+ }
+ rects = this.getSelectionRects( selection );
+ if ( rects ) {
+ for ( i = 0, l = rects.length; i < l; i++ ) {
+ this.$deactivatedSelection.append( this.$( '<div>'
).css( {
+ top: rects[i].top,
+ left: rects[i].left,
+ width: rects[i].width,
+ height: rects[i].height
+ } ) );
+ }
}
};
@@ -646,6 +724,7 @@
this.eventSequencer.attach( this.$element );
this.surfaceObserver.startTimerLoop();
this.focused = true;
+ this.activate();
this.emit( 'focus' );
};
@@ -662,12 +741,12 @@
this.surfaceObserver.stopTimerLoop();
this.surfaceObserver.pollOnce();
this.surfaceObserver.clear();
+ this.dragging = false;
+ this.focused = false;
if ( this.focusedNode ) {
this.focusedNode.setFocused( false );
this.focusedNode = null;
}
- this.dragging = false;
- this.focused = false;
this.getModel().setNullSelection();
this.emit( 'blur' );
};
@@ -1230,7 +1309,7 @@
}
}
this.renderSelectedContentBranchNode();
- this.showSelection( this.surface.getModel().getSelection() );
+ this.showSelection( this.getModel().getSelection() );
};
/**
@@ -1843,12 +1922,10 @@
* Handle model select events.
*
* @see ve.dm.Surface#method-change
- *
- * @method
- * @param {ve.dm.Selection} selection
*/
-ve.ce.Surface.prototype.onModelSelect = function ( selection ) {
- var focusedNode;
+ve.ce.Surface.prototype.onModelSelect = function () {
+ var focusedNode,
+ selection = this.getModel().getSelection();
this.contentBranchNodeChanged = false;
@@ -1892,10 +1969,10 @@
this.focusedNode = null;
}
- // If there is no focused node, use native selection, but ignore the
selection if
- // changeModelSelection is currently being called with the same
(object-identical)
- // selection object (i.e. if the model is calling us back)
- if ( !this.focusedNode && !this.isRenderingLocked() && selection !==
this.newModelSelection ) {
+ // Ignore the selection if changeModelSelection is currently being
+ // called with the same (object-identical) selection object
+ // (i.e. if the model is calling us back)
+ if ( !this.isRenderingLocked() && selection !== this.newModelSelection
) {
this.showSelection( selection );
this.checkUnicorns( false );
}
@@ -1960,7 +2037,7 @@
var surface = this;
if ( this.contentBranchNodeChanged ) {
// Update the selection state from model
- this.onModelSelect( this.surface.getModel().selection );
+ this.onModelSelect();
}
// Update the state of the SurfaceObserver
this.surfaceObserver.pollOnceNoEmit();
@@ -2084,7 +2161,7 @@
$paragraph = this.getDocument().getBranchNodeFromOffset( offset + 1
).$element;
$paragraph.wrap( this.$( '<div>' ).addClass(
've-ce-branchNode-blockSlugWrapper-former-unfocused' ) );
// Restore selection now that we've wrapped the node the selection was
in
- this.onModelSelect( model.getSelection() );
+ this.onModelSelect();
$paragraph.parent()
// Enable transitions
.addClass( 've-ce-branchNode-blockSlugWrapper-former' )
@@ -3033,7 +3110,13 @@
* @param {ve.dm.Selection} selection Selection to show
*/
ve.ce.Surface.prototype.showSelection = function ( selection ) {
- if ( !( selection instanceof ve.dm.LinearSelection ) ) {
+ if ( this.deactivated ) {
+ // Defer until view has updated
+ setTimeout( this.updateDeactivatedSelection.bind( this ) );
+ return;
+ }
+
+ if ( !( selection instanceof ve.dm.LinearSelection ) ||
this.focusedNode ) {
return;
}
@@ -3111,7 +3194,10 @@
var nativeRange, rangeSelection,
selection = this.getModel().getSelection();
- if ( range && selection instanceof ve.dm.LinearSelection &&
selection.getRange().equalsSelection( range ) ) {
+ if (
+ range && !this.deactivated &&
+ selection instanceof ve.dm.LinearSelection &&
selection.getRange().equalsSelection( range )
+ ) {
// Range requested is equivalent to native selection so reset
range = null;
}
diff --git a/src/ui/actions/ve.ui.WindowAction.js
b/src/ui/actions/ve.ui.WindowAction.js
index 17402d0..453d120 100644
--- a/src/ui/actions/ve.ui.WindowAction.js
+++ b/src/ui/actions/ve.ui.WindowAction.js
@@ -44,8 +44,7 @@
* @return {boolean} Action was executed
*/
ve.ui.WindowAction.prototype.open = function ( name, data ) {
- var onOpen, openingPromise,
- windowType = this.getWindowType( name ),
+ var windowType = this.getWindowType( name ),
windowManager = windowType && this.getWindowManager( windowType
),
surface = this.surface,
fragment = surface.getModel().getFragment( undefined, true ),
@@ -58,28 +57,17 @@
data = ve.extendObject( { dir: dir }, data, { fragment: fragment } );
+ surface.getView().deactivate();
if ( windowType === 'toolbar' ) {
data = ve.extendObject( data, { surface: surface } );
- } else if ( windowType === 'dialog' ) {
- // For non-isolated dialogs, remove the selection and re-apply
on close
- surface.getView().nativeSelection.removeAllRanges();
- onOpen = function ( opened ) {
- opened.then( function ( closing ) {
- closing.then( function () {
- // Check the dialog didn't modify the
selection before restoring from fragment
- if (
surface.getModel().getSelection().isNull() ) {
- fragment.select();
- }
- } );
- } );
- };
}
- openingPromise = windowManager.openWindow( name, data );
+ windowManager.openWindow( name, data ).then( function ( closing ) {
+ closing.then( function () {
+ surface.getView().activate();
+ } );
+ } );
- if ( onOpen ) {
- openingPromise.then( onOpen );
- }
return true;
};
diff --git a/src/ui/dialogs/ve.ui.FindAndReplaceDialog.js
b/src/ui/dialogs/ve.ui.FindAndReplaceDialog.js
index d711ca2..fb44e07 100644
--- a/src/ui/dialogs/ve.ui.FindAndReplaceDialog.js
+++ b/src/ui/dialogs/ve.ui.FindAndReplaceDialog.js
@@ -156,7 +156,7 @@
return ve.ui.FindAndReplaceDialog.super.prototype.getSetupProcess.call(
this, data )
.first( function () {
this.surface = data.surface;
- this.surface.$controls.append( this.$findResults );
+ this.surface.$selections.append( this.$findResults );
this.surface.getModel().connect( this, {
documentUpdate: this.updateFragmentsDebounced } );
this.surface.getView().connect( this, { position:
this.positionResultsDebounced } );
@@ -266,14 +266,14 @@
return;
}
- var i, l, j, rects, $result, top;
+ var i, ilen, j, jlen, rects, $result, top;
this.$findResults.empty();
- for ( i = 0, l = this.fragments.length; i < l; i++ ) {
+ for ( i = 0, ilen = this.fragments.length; i < ilen; i++ ) {
rects = this.surface.getView().getSelectionRects(
this.fragments[i].getSelection() );
$result = this.$( '<div>' ).addClass(
've-ui-findAndReplaceDialog-findResult' );
top = Infinity;
- for ( j in rects ) {
+ for ( j = 0, jlen = rects.length; j < jlen; j++ ) {
top = Math.min( top, rects[j].top );
$result.append( this.$( '<div>' ).css( {
top: rects[j].top,
diff --git a/src/ui/dialogs/ve.ui.ToolbarDialog.js
b/src/ui/dialogs/ve.ui.ToolbarDialog.js
index 160baca..4b0c458 100644
--- a/src/ui/dialogs/ve.ui.ToolbarDialog.js
+++ b/src/ui/dialogs/ve.ui.ToolbarDialog.js
@@ -29,6 +29,10 @@
OO.inheritClass( ve.ui.ToolbarDialog, OO.ui.Dialog );
+/* Static Properties */
+
+ve.ui.ToolbarDialog.static.size = 'full';
+
/* Methods */
/**
@@ -38,10 +42,5 @@
// Parent method
ve.ui.ToolbarDialog.super.prototype.initialize.call( this );
- // Events
- // Hack: required for keystrokes from isolated windows to make it back
to the target
- this.$content.on( 'keydown', ve.init.target.onDocumentKeyDown.bind(
ve.init.target ) );
- this.$content.on( 'keydown', ve.init.target.onTargetKeyDown.bind(
ve.init.target ) );
+ this.$content.addClass( 've-ui-toolbarDialog-content' );
};
-
-ve.ui.ToolbarDialog.static.size = 'full';
diff --git a/src/ui/inspectors/ve.ui.FragmentInspector.js
b/src/ui/inspectors/ve.ui.FragmentInspector.js
index ae14f69..dcac84b 100644
--- a/src/ui/inspectors/ve.ui.FragmentInspector.js
+++ b/src/ui/inspectors/ve.ui.FragmentInspector.js
@@ -73,9 +73,6 @@
// Events
this.form.connect( this, { submit: 'onFormSubmit' } );
- // Hack: required for keystrokes from isolated windows to make it back
to the target
- this.$content.on( 'keydown', ve.init.target.onDocumentKeyDown.bind(
ve.init.target ) );
- this.$content.on( 'keydown', ve.init.target.onTargetKeyDown.bind(
ve.init.target ) );
// Initialization
this.$element.addClass( 've-ui-fragmentInspector' );
diff --git a/src/ui/styles/dialogs/ve.ui.FindAndReplaceDialog.css
b/src/ui/styles/dialogs/ve.ui.FindAndReplaceDialog.css
index f62f456..6b3e9aa 100644
--- a/src/ui/styles/dialogs/ve.ui.FindAndReplaceDialog.css
+++ b/src/ui/styles/dialogs/ve.ui.FindAndReplaceDialog.css
@@ -52,7 +52,7 @@
opacity: 0.2;
}
-.ve-ui-findAndReplaceDialog-findResult div {
+.ve-ui-findAndReplaceDialog-findResult > div {
background: #28bb0b;
position: absolute;
margin-top: -0.15em;
@@ -64,6 +64,16 @@
opacity: 0.4;
}
-.ve-ui-findAndReplaceDialog-findResult-focused div {
+.ve-ui-findAndReplaceDialog-findResult-focused > div {
background: #1f850b;
}
+
+/* Set opacity directly on the highlights, rather than their containers,
+ otherwise the opacity isn't applied at all */
+.ve-init-target-ie .ve-ui-findAndReplaceDialog-findResult > div {
+ opacity: 0.2;
+}
+
+.ve-init-target-ie .ve-ui-findAndReplaceDialog-findResult-focused > div {
+ opacity: 0.4;
+}
diff --git a/src/ui/styles/dialogs/ve.ui.ToolbarDialog.css
b/src/ui/styles/dialogs/ve.ui.ToolbarDialog.css
index 1e10dbe..53abe9a 100644
--- a/src/ui/styles/dialogs/ve.ui.ToolbarDialog.css
+++ b/src/ui/styles/dialogs/ve.ui.ToolbarDialog.css
@@ -20,6 +20,11 @@
max-height: 150px;
}
+/* TODO: fix this upstream */
+.ve-ui-toolbar .oo-ui-window-frame {
+ position: relative;
+}
+
.ve-ui-toolbarDialog-content > .oo-ui-window-body {
bottom: auto;
box-shadow: none;
diff --git a/src/ui/styles/inspectors/ve.ui.FragmentInspector.css
b/src/ui/styles/inspectors/ve.ui.FragmentInspector.css
index 4051bc9..0e7bb9d 100644
--- a/src/ui/styles/inspectors/ve.ui.FragmentInspector.css
+++ b/src/ui/styles/inspectors/ve.ui.FragmentInspector.css
@@ -11,4 +11,9 @@
.ve-ui-fragmentInspector-content .oo-ui-processDialog-actions-other
.oo-ui-buttonElement-framed {
margin-top: 0;
+}
+
+/* Don't show scroll bars before ready for accurate measurement */
+.oo-ui-window-content-setup:not( .oo-ui-window-content-ready )
.ve-ui-fragmentInspector-container {
+ overflow: hidden;
}
\ No newline at end of file
diff --git a/src/ui/ve.ui.DesktopContext.js b/src/ui/ve.ui.DesktopContext.js
index efd8e25..03cc997 100644
--- a/src/ui/ve.ui.DesktopContext.js
+++ b/src/ui/ve.ui.DesktopContext.js
@@ -40,7 +40,6 @@
resize: 'setPopupSize'
} );
this.$window.on( 'resize', this.onWindowResizeHandler );
- this.$element.on( 'mousedown', false );
// Initialization
this.$element
@@ -138,14 +137,22 @@
$: this.$,
factory: ve.ui.windowFactory,
overlay: this.surface.getLocalOverlay(),
- modal: false,
- isolate: true
+ modal: false
} );
};
/**
* @inheritdoc
*/
+ve.ui.DesktopContext.prototype.onInspectorOpening = function () {
+ ve.ui.DesktopContext.super.prototype.onInspectorOpening.apply( this,
arguments );
+ // Resize the popup before opening so the body height of the window is
measured correctly
+ this.setPopupSize();
+};
+
+/**
+ * @inheritdoc
+ */
ve.ui.DesktopContext.prototype.toggle = function ( show ) {
var promise;
diff --git a/src/ui/ve.ui.MobileContext.js b/src/ui/ve.ui.MobileContext.js
index 5706079..963e361 100644
--- a/src/ui/ve.ui.MobileContext.js
+++ b/src/ui/ve.ui.MobileContext.js
@@ -50,8 +50,7 @@
ve.ui.MobileContext.prototype.createInspectorWindowManager = function () {
return new ve.ui.MobileWindowManager( {
factory: ve.ui.windowFactory,
- overlay: this.surface.getGlobalOverlay(),
- isolate: true
+ overlay: this.surface.getGlobalOverlay()
} );
};
diff --git a/src/ui/ve.ui.MobileSurface.js b/src/ui/ve.ui.MobileSurface.js
index cb3eb3f..85ca819 100644
--- a/src/ui/ve.ui.MobileSurface.js
+++ b/src/ui/ve.ui.MobileSurface.js
@@ -78,8 +78,7 @@
ve.ui.MobileSurface.prototype.createDialogWindowManager = function () {
return new ve.ui.MobileWindowManager( {
factory: ve.ui.windowFactory,
- overlay: this.globalOverlay,
- isolate: true
+ overlay: this.globalOverlay
} );
};
diff --git a/src/ui/ve.ui.Surface.js b/src/ui/ve.ui.Surface.js
index 697e55a..1e0618f 100644
--- a/src/ui/ve.ui.Surface.js
+++ b/src/ui/ve.ui.Surface.js
@@ -32,6 +32,7 @@
// Properties
this.globalOverlay = new ve.ui.Overlay( { classes:
['ve-ui-overlay-global'] } );
this.localOverlay = new ve.ui.Overlay( { $: this.$, classes:
['ve-ui-overlay-local'] } );
+ this.$selections = this.$( '<div>' );
this.$blockers = this.$( '<div>' );
this.$controls = this.$( '<div>' );
this.$menus = this.$( '<div>' );
@@ -63,8 +64,7 @@
this.toolbarDialogs = new ve.ui.ToolbarDialogWindowManager( {
$: this.$,
factory: ve.ui.windowFactory,
- modal: false,
- isolate: true
+ modal: false
} );
// Initialization
@@ -72,7 +72,8 @@
this.$element
.addClass( 've-ui-surface' )
.append( this.view.$element );
- this.localOverlay.$element.append( this.$blockers, this.$controls,
this.$menus );
+ this.view.$element.after( this.localOverlay.$element );
+ this.localOverlay.$element.append( this.$selections, this.$blockers,
this.$controls, this.$menus );
this.globalOverlay.$element.append( this.dialogs.$element );
};
@@ -116,7 +117,6 @@
// Remove DOM elements
this.$element.remove();
this.globalOverlay.$element.remove();
- this.localOverlay.$element.remove();
// Let others know we have been destroyed
this.emit( 'destroy' );
@@ -128,7 +128,6 @@
* This must be called after the surface has been attached to the DOM.
*/
ve.ui.Surface.prototype.initialize = function () {
- this.getView().$element.after( this.localOverlay.$element );
// Attach globalOverlay to the global <body>, not the local frame's
<body>
$( 'body' ).append( this.globalOverlay.$element );
--
To view, visit https://gerrit.wikimedia.org/r/178918
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I55c55439f93f9780eda2014c5a5f46270129e609
Gerrit-PatchSet: 6
Gerrit-Project: VisualEditor/VisualEditor
Gerrit-Branch: master
Gerrit-Owner: Esanders <[email protected]>
Gerrit-Reviewer: Alex Monk <[email protected]>
Gerrit-Reviewer: Catrope <[email protected]>
Gerrit-Reviewer: Esanders <[email protected]>
Gerrit-Reviewer: jenkins-bot <>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits