Esanders has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/86168


Change subject: Prevent context menu from flickering after FocusableNode redraw
......................................................................

Prevent context menu from flickering after FocusableNode redraw

Pass an extra parameter to show() to let it know when the menu is
just being moved, and therefore doesn't need to perform the fade-in
transition.

Change-Id: I2cf2ff07db6cc7d226f3d626755792a06dfcbe54
---
M modules/ve/ce/ve.ce.FocusableNode.js
M modules/ve/ui/ve.ui.Context.js
2 files changed, 7 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/VisualEditor 
refs/changes/68/86168/1

diff --git a/modules/ve/ce/ve.ce.FocusableNode.js 
b/modules/ve/ce/ve.ce.FocusableNode.js
index 309e781..96d0716 100644
--- a/modules/ve/ce/ve.ce.FocusableNode.js
+++ b/modules/ve/ce/ve.ce.FocusableNode.js
@@ -107,7 +107,7 @@
        if ( this.focused ) {
                this.redrawHighlight();
                // reposition menu
-               this.surface.getSurface().getContext().show( true );
+               this.surface.getSurface().getContext().show( true, true );
        }
 };
 
diff --git a/modules/ve/ui/ve.ui.Context.js b/modules/ve/ui/ve.ui.Context.js
index fe9618c..8c3f8a3 100644
--- a/modules/ve/ui/ve.ui.Context.js
+++ b/modules/ve/ui/ve.ui.Context.js
@@ -320,9 +320,11 @@
  * Shows the context menu.
  *
  * @method
+ * @param {boolean} [transition=false] Use a smooth transition
+ * @param {boolean} [repositionOnly=false] The context is only being moved so 
don't fade in
  * @chainable
  */
-ve.ui.Context.prototype.show = function ( transition ) {
+ve.ui.Context.prototype.show = function ( transition, repositionOnly ) {
        var inspector = this.inspectors.getCurrent(),
                focusedNode = this.surface.getView().getFocusedNode();
 
@@ -336,7 +338,9 @@
                if ( inspector ) {
                        this.$menu.hide();
                        this.inspectors.$.show();
-                       inspector.$.css( 'opacity', 0 );
+                       if ( !repositionOnly ) {
+                               inspector.$.css( 'opacity', 0 );
+                       }
                        // Update size and fade the inspector in after 
animation is complete
                        setTimeout( ve.bind( function () {
                                inspector.fitHeightToContents();

-- 
To view, visit https://gerrit.wikimedia.org/r/86168
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I2cf2ff07db6cc7d226f3d626755792a06dfcbe54
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/VisualEditor
Gerrit-Branch: master
Gerrit-Owner: Esanders <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to