jenkins-bot has submitted this change and it was merged.
Change subject: Improve saving in VE
......................................................................
Improve saving in VE
* Use .saving-header so that saving spinner looks the same as in wikitext
editor.
* Remove unnecessary spinner shown below the edit summary input.
Change-Id: I35e04da00db15112bb8a109e5acb9e0a604925db
---
M javascripts/modules/editor/VisualEditorOverlay.js
1 file changed, 14 insertions(+), 16 deletions(-)
Approvals:
Jdlrobson: Looks good to me, approved
jenkins-bot: Verified
diff --git a/javascripts/modules/editor/VisualEditorOverlay.js
b/javascripts/modules/editor/VisualEditorOverlay.js
index 2b662aa..1ecdbd8 100644
--- a/javascripts/modules/editor/VisualEditorOverlay.js
+++ b/javascripts/modules/editor/VisualEditorOverlay.js
@@ -61,26 +61,17 @@
this.docToSave = false;
},
prepareForSave: function() {
- var self = this,
- doc =
this.target.surface.getModel().getDocument();
this.$( '.surface' ).hide();
- self._showHidden( '.save-header, .save-panel' );
- self.$( '.submit' ).prop( 'disabled', true );
- this.$spinner.show();
- // Preload the serialization
- if ( !this.docToSave ) {
- this.docToSave =
ve.dm.converter.getDomFromModel( doc );
- }
- this.target.prepareCacheKey( this.docToSave ).done(
function () {
- self.clearSpinner();
- self.$( '.submit' ).prop( 'disabled', false );
- } );
+ this._showHidden( '.save-header, .save-panel' );
},
save: function() {
- var summary = this.$( '.save-panel input' ).val(),
+ var
+ self = this,
+ doc =
this.target.surface.getModel().getDocument(),
+ summary = this.$( '.save-panel input' ).val(),
options = { summary: summary };
- this.$spinner.show();
+ this._showHidden( '.saving-header' );
// Stop the confirmation message from being thrown when
you hit save.
this.hasChanged = false;
this.$( '.surface, .summary-area' ).hide();
@@ -89,7 +80,14 @@
options.captchaid = this.captchaId;
options.captchaword = this.$( '.captcha-word'
).val();
}
- this.target.save( this.docToSave, options );
+
+ // Preload the serialization
+ if ( !this.docToSave ) {
+ this.docToSave =
ve.dm.converter.getDomFromModel( doc );
+ }
+ this.target.prepareCacheKey( this.docToSave ).done(
function () {
+ self.target.save( self.docToSave, options );
+ } );
},
showSpinner: function () {
this.$spinner.show();
--
To view, visit https://gerrit.wikimedia.org/r/115549
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I35e04da00db15112bb8a109e5acb9e0a604925db
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/MobileFrontend
Gerrit-Branch: master
Gerrit-Owner: JGonera <[email protected]>
Gerrit-Reviewer: Jdlrobson <[email protected]>
Gerrit-Reviewer: jenkins-bot <>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits