Catrope has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/95731


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

Don't open 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, 10 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/VisualEditor 
refs/changes/31/95731/1

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 15be0bf..965c49b 100644
--- a/modules/ve-mw/init/targets/ve.init.mw.ViewPageTarget.js
+++ b/modules/ve-mw/init/targets/ve.init.mw.ViewPageTarget.js
@@ -228,7 +228,6 @@
                this.setUpSurface( doc, ve.bind( function() {
                        this.startSanityCheck();
                        this.setupToolbarButtons();
-                       this.setupSaveDialog();
                        this.attachToolbarButtons();
                        this.restoreScrollPosition();
                        this.restoreEditSection();
@@ -605,7 +604,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();
+       }
 };
 
 /**
@@ -1225,8 +1229,11 @@
  * @method
  */
 ve.init.mw.ViewPageTarget.prototype.showSaveDialog = function () {
+       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: newchange
Gerrit-Change-Id: I02077c3e45f01d3467d41616eb879bd1d608a82b
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/VisualEditor
Gerrit-Branch: master
Gerrit-Owner: Catrope <[email protected]>

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

Reply via email to