jenkins-bot has submitted this change and it was merged.

Change subject: Do not eagerly initialize notification area
......................................................................


Do not eagerly initialize notification area

Change-Id: Icf7e969e1602f8681a0f1faea4458c9d8a195f9b
---
M view/resources/jquery/wikibase/jquery.wikibase.entitytermsview.js
1 file changed, 14 insertions(+), 16 deletions(-)

Approvals:
  Thiemo Mättig (WMDE): Looks good to me, approved
  jenkins-bot: Verified



diff --git a/view/resources/jquery/wikibase/jquery.wikibase.entitytermsview.js 
b/view/resources/jquery/wikibase/jquery.wikibase.entitytermsview.js
index 5f1ade2..29bc448 100644
--- a/view/resources/jquery/wikibase/jquery.wikibase.entitytermsview.js
+++ b/view/resources/jquery/wikibase/jquery.wikibase.entitytermsview.js
@@ -171,8 +171,7 @@
         * @inheritdoc
         */
        draw: function() {
-               var self = this,
-                       deferred = $.Deferred();
+               var deferred = $.Deferred();
 
                this.$entitytermsforlanguagelistview
                        = this.element.find( 
'.wikibase-entitytermsforlanguagelistview' );
@@ -193,17 +192,6 @@
                        // TODO: Remove as soon as drop-down edit buttons are 
implemented. The language list may
                        // then be shown (without directly switching to edit 
mode) using the drop down menu.
                        this._createEntitytermsforlanguagelistviewToggler();
-               }
-
-               if ( !this._$notification ) {
-                       this.notification()
-                               .appendTo( 
this._getEntitytermsforlanguagelistview().$header )
-                               .on( 'closeableupdate.' + this.widgetName, 
function() {
-                                       var sticknode = self.element.data( 
'sticknode' );
-                                       if ( sticknode ) {
-                                               sticknode.refresh();
-                                       }
-                               } );
                }
 
                return deferred.resolve().promise();
@@ -492,16 +480,26 @@
         * @inheritdoc
         */
        notification: function( $content, additionalCssClasses ) {
+               var self = this;
                if ( !this._$notification ) {
                        var $closeable = $( '<div/>' ).closeable();
 
                        this._$notification = $( '<tr/>' ).append( $( '<td/>' 
).append( $closeable ) );
 
                        this._$notification.data( 'closeable', $closeable.data( 
'closeable' ) );
-               }
+                       this._$notification
+                               .appendTo( 
this._getEntitytermsforlanguagelistview().$header )
+                               .on( 'closeableupdate.' + this.widgetName, 
function() {
+                                               var sticknode = 
self.element.data( 'sticknode' );
+                                               if ( sticknode ) {
+                                                       sticknode.refresh();
+                                               }
+                               } );
 
-               var $headerTr = 
this._getEntitytermsforlanguagelistview().$header.children( 'tr' ).first();
-               this._$notification.children( 'td' ).attr( 'colspan', 
$headerTr.children().length );
+                       var $headerTr = 
this._getEntitytermsforlanguagelistview().$header.children( 'tr' ).first();
+                       this._$notification.children( 'td' ).attr( 'colspan', 
$headerTr.children().length );
+
+               }
 
                this._$notification.data( 'closeable' ).setContent( $content, 
additionalCssClasses );
                return this._$notification;

-- 
To view, visit https://gerrit.wikimedia.org/r/274397
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Icf7e969e1602f8681a0f1faea4458c9d8a195f9b
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Adrian Heine <[email protected]>
Gerrit-Reviewer: Adrian Heine <[email protected]>
Gerrit-Reviewer: Jonas Kress (WMDE) <[email protected]>
Gerrit-Reviewer: Thiemo Mättig (WMDE) <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

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

Reply via email to