From 062b2ed6814ab0b0a96bbbfaaa5e635c60ee4efe Mon Sep 17 00:00:00 2001 From: Trevor Parscal Date: Thu, 17 Apr 2014 15:06:11 -0700 Subject: [PATCH] Make transclusion dialog "pending" while loading Also, only allow animation of anything after things are ready Depends on I5c45cc6 in oojs-ui Change-Id: I2fa71a1d9a43db960aac4c1fad87eae96c898fad --- modules/ve-mw/ui/dialogs/ve.ui.MWTemplateDialog.js | 4 ++++ .../ve-mw/ui/styles/ve.ui.MWTransclusionDialog.css | 11 ++++++----- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/modules/ve-mw/ui/dialogs/ve.ui.MWTemplateDialog.js b/modules/ve-mw/ui/dialogs/ve.ui.MWTemplateDialog.js index cc73c8c162..a3d7fad6bc 100644 --- a/modules/ve-mw/ui/dialogs/ve.ui.MWTemplateDialog.js +++ b/modules/ve-mw/ui/dialogs/ve.ui.MWTemplateDialog.js @@ -51,6 +51,8 @@ ve.ui.MWTemplateDialog.static.bookletLayoutConfig = { */ ve.ui.MWTemplateDialog.prototype.onTransclusionReady = function () { this.loaded = true; + this.$element.addClass( 've-ui-mwTemplateDialog-ready' ); + this.popPending(); }; /** @@ -343,6 +345,7 @@ ve.ui.MWTemplateDialog.prototype.setup = function ( data ) { .load( ve.copy( this.transclusionNode.getAttribute( 'mw' ) ) ); } promise.always( ve.bind( this.onTransclusionReady, this ) ); + this.pushPending(); }; /** @@ -357,6 +360,7 @@ ve.ui.MWTemplateDialog.prototype.teardown = function ( data ) { this.saveChanges(); } + this.$element.removeClass( 've-ui-mwTemplateDialog-ready' ); this.transclusion.disconnect( this ); this.transclusion.abortRequests(); this.transclusion = null; diff --git a/modules/ve-mw/ui/styles/ve.ui.MWTransclusionDialog.css b/modules/ve-mw/ui/styles/ve.ui.MWTransclusionDialog.css index b6db986ff7..28e5425f34 100644 --- a/modules/ve-mw/ui/styles/ve.ui.MWTransclusionDialog.css +++ b/modules/ve-mw/ui/styles/ve.ui.MWTransclusionDialog.css @@ -35,11 +35,12 @@ top: 1.5em; } -.ve-ui-mwTransclusionDialog .oo-ui-bookletLayout .oo-ui-fieldsetLayout > .oo-ui-labeledElement-label, -.ve-ui-mwTransclusionDialog .oo-ui-bookletLayout .oo-ui-fieldsetLayout > .oo-ui-iconedElement-icon, -.ve-ui-mwTransclusionDialog .oo-ui-bookletLayout .ve-ui-mwTransclusionDialog-removeButton, -.ve-ui-mwTransclusionDialog .oo-ui-bookletLayout .ve-ui-mwTemplatePage-more, -.ve-ui-mwTransclusionDialog .oo-ui-bookletLayout .ve-ui-mwParameterPage-more { +.ve-ui-mwTransclusionDialog.ve-ui-mwTemplateDialog-ready .oo-ui-bookletLayout .oo-ui-fieldsetLayout > .oo-ui-labeledElement-label, +.ve-ui-mwTransclusionDialog.ve-ui-mwTemplateDialog-ready .oo-ui-bookletLayout .oo-ui-fieldsetLayout > .oo-ui-iconedElement-icon, +.ve-ui-mwTransclusionDialog.ve-ui-mwTemplateDialog-ready .oo-ui-bookletLayout .ve-ui-mwTransclusionDialog-removeButton, +.ve-ui-mwTransclusionDialog.ve-ui-mwTemplateDialog-ready .oo-ui-bookletLayout .ve-ui-mwTemplatePage-more, +.ve-ui-mwTransclusionDialog.ve-ui-mwTemplateDialog-ready .oo-ui-bookletLayout .ve-ui-mwParameterPage-more, +.ve-ui-mwTransclusionDialog.ve-ui-mwTemplateDialog-ready .oo-ui-bookletLayout > .oo-ui-gridLayout > .oo-ui-panelLayout { -webkit-transition: all 250ms ease-in-out; -moz-transition: all 250ms ease-in-out; -o-transition: all 250ms ease-in-out;