Merge "Tear down the save dialog and remove it from memory on surface teardown"

This commit is contained in:
jenkins-bot 2013-12-01 22:23:06 +00:00 committed by Gerrit Code Review
commit 97adcc2103

View file

@ -195,11 +195,6 @@ ve.init.mw.ViewPageTarget.prototype.deactivate = function ( override ) {
this.detachToolbarButtons();
}
if ( this.saveDialog ) {
// If we got as far as setting up the save dialog, tear it down
this.saveDialog.reset();
this.saveDialog.close();
}
// Check we got as far as setting up the surface
if ( this.active ) {
// If we got as far as setting up the surface, tear that down
@ -1062,6 +1057,12 @@ ve.init.mw.ViewPageTarget.prototype.tearDownSurface = function () {
}
this.tearDownToolbar();
this.restoreDocumentTitle();
if ( this.saveDialog ) {
// If we got as far as setting up the save dialog, tear it down
this.saveDialog.close();
this.saveDialog.teardown();
this.saveDialog = null;
}
// Destroy surface
if ( this.surface ) {
this.surface.destroy();