mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-29 00:30:44 +00:00
Merge "Prevent context menu from flickering after FocusableNode redraw"
This commit is contained in:
commit
b4f415ecc4
|
@ -107,7 +107,7 @@ ve.ce.FocusableNode.prototype.onFocusableRerender = function () {
|
|||
if ( this.focused ) {
|
||||
this.redrawHighlight();
|
||||
// reposition menu
|
||||
this.surface.getSurface().getContext().show( true );
|
||||
this.surface.getSurface().getContext().show( true, true );
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
@ -318,9 +318,11 @@ ve.ui.Context.prototype.updateDimensions = function ( transition ) {
|
|||
* 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();
|
||||
|
||||
|
@ -334,7 +336,9 @@ ve.ui.Context.prototype.show = function ( transition ) {
|
|||
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();
|
||||
|
|
Loading…
Reference in a new issue