mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-24 22:35:41 +00:00
Merge "Use a sane recursion guard in ve.ui.Context.prototype.hide()"
This commit is contained in:
commit
fad9ae6c50
|
@ -24,6 +24,7 @@ ve.ui.Context = function VeUiContext( surface, config ) {
|
|||
this.inspectors = {};
|
||||
this.visible = false;
|
||||
this.showing = false;
|
||||
this.hiding = false;
|
||||
this.selecting = false;
|
||||
this.relocating = false;
|
||||
this.embedded = false;
|
||||
|
@ -382,16 +383,17 @@ ve.ui.Context.prototype.show = function ( transition, repositionOnly ) {
|
|||
ve.ui.Context.prototype.hide = function () {
|
||||
var inspector = this.inspectors.getCurrent();
|
||||
|
||||
// Guard against recursion: closing the inspector causes onInspectorClose to call us again
|
||||
if ( !this.hiding ) {
|
||||
this.hiding = true;
|
||||
if ( inspector ) {
|
||||
// This will recurse, but inspector will be undefined next time
|
||||
inspector.close( 'hide' );
|
||||
return this;
|
||||
}
|
||||
|
||||
this.popup.hide();
|
||||
this.$.hide();
|
||||
this.visible = false;
|
||||
|
||||
this.hiding = false;
|
||||
}
|
||||
return this;
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in a new issue