mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-15 10:35:48 +00:00
Merge "Followup 1c04d32d
: release saveDialog reference even if closed"
This commit is contained in:
commit
09bfc0cb9c
|
@ -1019,9 +1019,11 @@ ve.init.mw.ViewPageTarget.prototype.tearDownSurface = function () {
|
|||
this.surface.mwTocWidget.teardown();
|
||||
}
|
||||
|
||||
if ( this.saveDialog && this.saveDialog.isOpened() ) {
|
||||
// If the save dialog is still open (from saving) close it
|
||||
promises.push( this.saveDialog.close() );
|
||||
if ( this.saveDialog ) {
|
||||
if ( this.saveDialog.isOpened() ) {
|
||||
// If the save dialog is still open (from saving) close it
|
||||
promises.push( this.saveDialog.close() );
|
||||
}
|
||||
// Release the reference
|
||||
this.saveDialog = null;
|
||||
}
|
||||
|
@ -1173,7 +1175,7 @@ ve.init.mw.ViewPageTarget.prototype.showSaveDialog = function () {
|
|||
{ dir: this.surface.getModel().getDocument().getLang() }
|
||||
)
|
||||
// Call onSaveDialogClose() when the save dialog starts closing
|
||||
.always( function ( opened ) {
|
||||
.done( function ( opened ) {
|
||||
opened.always( target.onSaveDialogClose.bind( target ) );
|
||||
} );
|
||||
}.bind( this ) );
|
||||
|
|
Loading…
Reference in a new issue