From b6f1793bf811b130950bca889d932f81e7335954 Mon Sep 17 00:00:00 2001 From: Krenair Date: Fri, 18 Apr 2014 21:32:25 +0100 Subject: [PATCH] Use new OOUI pending feature rather than loading bar thing on save dialog See I5c45cc6 for the oojs-ui change and I2fa71a1d for a similar commit Change-Id: I77e3274a196bc13ae19a9520197f4a8b624fd528 --- .../init/styles/ve.init.mw.ViewPageTarget.css | 3 +-- .../init/targets/ve.init.mw.ViewPageTarget.js | 16 ++++++++-------- modules/ve-mw/ui/dialogs/ve.ui.MWSaveDialog.js | 7 ++----- .../ui/styles/dialogs/ve.ui.MWSaveDialog.css | 10 ---------- 4 files changed, 11 insertions(+), 25 deletions(-) diff --git a/modules/ve-mw/init/styles/ve.init.mw.ViewPageTarget.css b/modules/ve-mw/init/styles/ve.init.mw.ViewPageTarget.css index 6abe4a8ce9..3ecdd336f9 100644 --- a/modules/ve-mw/init/styles/ve.init.mw.ViewPageTarget.css +++ b/modules/ve-mw/init/styles/ve.init.mw.ViewPageTarget.css @@ -121,8 +121,7 @@ /* Images */ -.ve-init-mw-viewPageTarget-loading, -.ve-ui-mwSaveDialog-working { +.ve-init-mw-viewPageTarget-loading { /* @embed */ background-image: url(images/loading-ltr.gif); } 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 17f43a112f..be7a4b151f 100644 --- a/modules/ve-mw/init/targets/ve.init.mw.ViewPageTarget.js +++ b/modules/ve-mw/init/targets/ve.init.mw.ViewPageTarget.js @@ -442,7 +442,7 @@ ve.init.mw.ViewPageTarget.prototype.onSave = function ( html, categoriesHtml, ne */ ve.init.mw.ViewPageTarget.prototype.onSaveAsyncBegin = function () { this.saveDialog.saveButton.setDisabled( true ); - this.saveDialog.$loadingIcon.show(); + this.saveDialog.pushPending(); }; /** @@ -452,7 +452,7 @@ ve.init.mw.ViewPageTarget.prototype.onSaveAsyncBegin = function () { */ ve.init.mw.ViewPageTarget.prototype.onSaveAsyncComplete = function () { this.saveDialog.saveButton.setDisabled( false ); - this.saveDialog.$loadingIcon.hide(); + this.saveDialog.popPending(); }; /** @@ -613,7 +613,7 @@ ve.init.mw.ViewPageTarget.prototype.onShowChanges = function ( diffHtml ) { */ ve.init.mw.ViewPageTarget.prototype.onShowChangesError = function ( jqXHR, status ) { alert( ve.msg( 'visualeditor-differror', status ) ); - this.saveDialog.$loadingIcon.hide(); + this.saveDialog.popPending(); }; /** @@ -629,7 +629,7 @@ ve.init.mw.ViewPageTarget.prototype.onSerializeError = function ( jqXHR, status // 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(); + this.saveDialog.popPending(); } }; @@ -639,7 +639,7 @@ ve.init.mw.ViewPageTarget.prototype.onSerializeError = function ( jqXHR, status * @method */ ve.init.mw.ViewPageTarget.prototype.onEditConflict = function () { - this.saveDialog.$loadingIcon.hide(); + this.saveDialog.popPending(); this.saveDialog.swapPanel( 'conflict' ); }; @@ -649,7 +649,7 @@ ve.init.mw.ViewPageTarget.prototype.onEditConflict = function () { * @method */ ve.init.mw.ViewPageTarget.prototype.onNoChanges = function () { - this.saveDialog.$loadingIcon.hide(); + this.saveDialog.popPending(); this.saveDialog.swapPanel( 'nochanges' ); this.saveDialog.reviewGoodButton.setDisabled( false ); }; @@ -775,7 +775,7 @@ ve.init.mw.ViewPageTarget.prototype.onSaveDialogReview = function () { if ( !this.saveDialog.$reviewViewer.find( 'table, pre' ).length ) { this.emit( 'saveReview' ); this.saveDialog.reviewGoodButton.setDisabled( true ); - this.saveDialog.$loadingIcon.show(); + this.saveDialog.pushPending(); if ( this.pageExists ) { // Has no callback, handled via target.onShowChanges this.showChanges( this.docToSave ); @@ -828,7 +828,7 @@ ve.init.mw.ViewPageTarget.prototype.saveDocument = function () { ); } else { this.saveDialog.saveButton.setDisabled( true ); - this.saveDialog.$loadingIcon.show(); + this.saveDialog.pushPending(); this.save( this.docToSave, saveOptions ); } }; diff --git a/modules/ve-mw/ui/dialogs/ve.ui.MWSaveDialog.js b/modules/ve-mw/ui/dialogs/ve.ui.MWSaveDialog.js index 30592757a2..a8b3f48456 100644 --- a/modules/ve-mw/ui/dialogs/ve.ui.MWSaveDialog.js +++ b/modules/ve-mw/ui/dialogs/ve.ui.MWSaveDialog.js @@ -72,7 +72,7 @@ ve.ui.MWSaveDialog.static.title = ve.ui.MWSaveDialog.prototype.setDiffAndReview = function ( content ) { this.$reviewViewer.empty().append( content ); this.reviewGoodButton.setDisabled( false ); - this.$loadingIcon.hide(); + this.popPending(); this.swapPanel( 'review' ); }; @@ -412,16 +412,13 @@ ve.ui.MWSaveDialog.prototype.initialize = function () { } ); this.resolveConflictButton.connect( this, { 'click': [ 'emit', 'resolve' ] } ); - this.$loadingIcon = this.$( '
' ).addClass( 've-ui-mwSaveDialog-working' ); - // Initialization this.$body.append( this.panel.$element ); this.$foot.append( this.reviewButton.$element, this.saveButton.$element, this.reviewGoodButton.$element, - this.resolveConflictButton.$element, - this.$loadingIcon + this.resolveConflictButton.$element ); this.setupDeferred.resolve(); diff --git a/modules/ve-mw/ui/styles/dialogs/ve.ui.MWSaveDialog.css b/modules/ve-mw/ui/styles/dialogs/ve.ui.MWSaveDialog.css index ffcc9ec4e8..fb972b889e 100644 --- a/modules/ve-mw/ui/styles/dialogs/ve.ui.MWSaveDialog.css +++ b/modules/ve-mw/ui/styles/dialogs/ve.ui.MWSaveDialog.css @@ -75,16 +75,6 @@ color: #aaa; } -.ve-ui-mwSaveDialog-working { - display: none; - float: right; - height: 2.5em; - width: 128px; - margin-right: 1em; - background-position: right center; - background-repeat: no-repeat; -} - .ve-ui-mwSaveDialog-license, .ve-ui-mwSaveDialog-dirtymsg, .ve-ui-mwSaveDialog-report-notice {