jenkins-bot has submitted this change and it was merged.

Change subject: Don't build out save dialog when initializing editor
......................................................................


Don't build out save dialog when initializing editor

The save dialog DOM is pretty big, so building it on demand
like every other dialog out there seems like a good idea.

Change-Id: I02077c3e45f01d3467d41616eb879bd1d608a82b
---
M modules/ve-mw/init/targets/ve.init.mw.ViewPageTarget.js
1 file changed, 11 insertions(+), 3 deletions(-)

Approvals:
  Krinkle: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/modules/ve-mw/init/targets/ve.init.mw.ViewPageTarget.js 
b/modules/ve-mw/init/targets/ve.init.mw.ViewPageTarget.js
index 73cbd92..0742c62 100644
--- a/modules/ve-mw/init/targets/ve.init.mw.ViewPageTarget.js
+++ b/modules/ve-mw/init/targets/ve.init.mw.ViewPageTarget.js
@@ -231,7 +231,6 @@
                        this.attachToolbarButtons();
                        this.restoreScrollPosition();
                        this.restoreEditSection();
-                       this.setupSaveDialog();
                        this.setupBeforeUnloadHandler();
                        this.$document[0].focus();
                        this.activating = false;
@@ -611,7 +610,12 @@
                ve.track( 'performance.user.reviewError', { 'duration': 
ve.now() - this.timings.saveDialogReview } );
        }
        alert( ve.msg( 'visualeditor-serializeerror', status ) );
-       this.saveDialog.$loadingIcon.hide();
+
+       // It's possible to get here while the save dialog has never been 
opened (if the user uses
+       // the switch to source mode option)
+       if ( this.saveDialog ) {
+               this.saveDialog.$loadingIcon.hide();
+       }
 };
 
 /**
@@ -1235,8 +1239,12 @@
        }
        this.prepareCacheKey( this.docToSave );
 
+       if ( !this.saveDialog ) {
+               this.setupSaveDialog();
+       }
+
        this.saveDialog.setSanityCheck( this.sanityCheckVerified );
-       this.surface.getDialogs().getWindow( 'mwSave' ).open();
+       this.saveDialog.open();
        this.timings.saveDialogOpen = ve.now();
        ve.track( 'behavior.lastTransactionTillSaveDialogOpen', {
                'duration': this.timings.saveDialogOpen - 
this.timings.lastTransaction

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I02077c3e45f01d3467d41616eb879bd1d608a82b
Gerrit-PatchSet: 13
Gerrit-Project: mediawiki/extensions/VisualEditor
Gerrit-Branch: master
Gerrit-Owner: Catrope <[email protected]>
Gerrit-Reviewer: Krinkle <[email protected]>
Gerrit-Reviewer: Robmoen <[email protected]>
Gerrit-Reviewer: jenkins-bot

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

Reply via email to