Eranroz has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/299285

Change subject: Earlier evaluation of compactlinks
......................................................................

Earlier evaluation of compactlinks

1. Proper declaration of dependecies
2. Remove late evaluation code (ready)

Bug: T136463
Change-Id: Ib36ef6a2b9955189acfbe06bd6b498a66014cf06
---
M extension.json
M resources/js/ext.uls.compactlinks.js
2 files changed, 16 insertions(+), 18 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/UniversalLanguageSelector 
refs/changes/85/299285/1

diff --git a/extension.json b/extension.json
index c590899..b43131d 100644
--- a/extension.json
+++ b/extension.json
@@ -237,12 +237,14 @@
                        "dependencies": [
                                "es5-shim",
                                "mediawiki.language",
-                               "mediawiki.ui.button"
+                               "mediawiki.ui.button",
+                               "ext.uls.init"
                        ],
                        "messages": [
                                "ext-uls-compact-link-count",
                                "ext-uls-compact-link-info"
                        ],
+                       "position": "top",
                        "localBasePath": "resources",
                        "remoteExtPath": "UniversalLanguageSelector/resources"
                },
diff --git a/resources/js/ext.uls.compactlinks.js 
b/resources/js/ext.uls.compactlinks.js
index 5d04dec..f809400 100644
--- a/resources/js/ext.uls.compactlinks.js
+++ b/resources/js/ext.uls.compactlinks.js
@@ -64,15 +64,13 @@
                        return;
                }
 
-               mw.loader.using( 'ext.uls.init' ).done( function () {
-                       // If we're only a bit beyond max, limit to 7 instead 
of 9.
-                       // FIXME: This assumes the max is 9.
-                       self.compactSize = ( self.listSize <= 12 ) ? 7 : max;
-                       self.compactList = self.getCompactList();
-                       self.hideOriginal();
-                       self.render();
-                       self.listen();
-               } );
+               // If we're only a bit beyond max, limit to 7 instead of 9.
+               // FIXME: This assumes the max is 9.
+               self.compactSize = ( self.listSize <= 12 ) ? 7 : max;
+               self.compactList = self.getCompactList();
+               self.hideOriginal();
+               self.render();
+               self.listen();
        };
 
        /**
@@ -391,13 +389,11 @@
                this.$trigger = $trigger;
        };
 
-       $( document ).ready( function () {
-               var compactList;
-
-               compactList = new CompactInterlanguageList( $( '#p-lang ul' ), {
-                       // Compact the list to this size
-                       max: 9
-               } );
-               compactList.init();
+       var compactList;
+       compactList = new CompactInterlanguageList( $( '#p-lang ul' ), {
+               // Compact the list to this size
+               max: 9
        } );
+       compactList.init();
+
 }( jQuery, mediaWiki ) );

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ib36ef6a2b9955189acfbe06bd6b498a66014cf06
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/UniversalLanguageSelector
Gerrit-Branch: master
Gerrit-Owner: Eranroz <eranro...@gmail.com>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to