Henning Snater has uploaded a new change for review. https://gerrit.wikimedia.org/r/158606
Change subject: Optimized applying wb-empty class in label/descriptionview ...................................................................... Optimized applying wb-empty class in label/descriptionview Change-Id: Ib051834e50bed20e323bf5cf8ba29a2224c9c01e --- M lib/resources/jquery.wikibase/jquery.wikibase.descriptionview.js M lib/resources/jquery.wikibase/jquery.wikibase.labelview.js 2 files changed, 4 insertions(+), 2 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Wikibase refs/changes/06/158606/1 diff --git a/lib/resources/jquery.wikibase/jquery.wikibase.descriptionview.js b/lib/resources/jquery.wikibase/jquery.wikibase.descriptionview.js index 1536387..3946847 100644 --- a/lib/resources/jquery.wikibase/jquery.wikibase.descriptionview.js +++ b/lib/resources/jquery.wikibase/jquery.wikibase.descriptionview.js @@ -115,6 +115,8 @@ * Main draw routine. */ _draw: function() { + this.element[this.options.value.description ? 'removeClass' : 'addClass']( 'wb-empty' ); + if( !this._isInEditMode ) { this.$text.text( this.options.value.description || mw.msg( 'wikibase-description-empty' ) @@ -234,7 +236,6 @@ this.$text.children( 'input' ).val( '' ); } - this.element[this.options.value.description ? 'removeClass' : 'addClass']( 'wb-empty' ); this.element.removeClass( 'wb-edit' ); this._isBeingEdited = false; this._isInEditMode = false; diff --git a/lib/resources/jquery.wikibase/jquery.wikibase.labelview.js b/lib/resources/jquery.wikibase/jquery.wikibase.labelview.js index ab1fe64..785d98d 100644 --- a/lib/resources/jquery.wikibase/jquery.wikibase.labelview.js +++ b/lib/resources/jquery.wikibase/jquery.wikibase.labelview.js @@ -129,6 +129,8 @@ this.$entityId.empty(); } + this.element[this.options.value.label ? 'removeClass' : 'addClass']( 'wb-empty' ); + if( !this._isInEditMode ) { this.$text.text( this.options.value.label || mw.msg( 'wikibase-label-empty' ) ); return; @@ -246,7 +248,6 @@ this.$text.children( 'input' ).val( '' ); } - this.element[this.options.value.label ? 'removeClass' : 'addClass']( 'wb-empty' ); this.element.removeClass( 'wb-edit' ); this._isBeingEdited = false; this._isInEditMode = false; -- To view, visit https://gerrit.wikimedia.org/r/158606 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ib051834e50bed20e323bf5cf8ba29a2224c9c01e Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Wikibase Gerrit-Branch: master Gerrit-Owner: Henning Snater <henning.sna...@wikimedia.de> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits