Phuedx has uploaded a new change for review.

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

Change subject: Hygiene: Use spinner template instead of Icon
......................................................................

Hygiene: Use spinner template instead of Icon

spinner.hogan is currently used to render the spinner that indicates
communication with the server.

Use the spinner.hogan template in notifications.js instead of an
instance of the Icon class that isn't configured correctly.

Bug: 73251

Change-Id: I792c1aacafc075e86a0b060e2318e7e129c14182
---
M javascripts/modules/notifications/notifications.js
M less/ui.less
2 files changed, 13 insertions(+), 9 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MobileFrontend 
refs/changes/43/172743/1

diff --git a/javascripts/modules/notifications/notifications.js 
b/javascripts/modules/notifications/notifications.js
index c4bdf59..84d1ab8 100644
--- a/javascripts/modules/notifications/notifications.js
+++ b/javascripts/modules/notifications/notifications.js
@@ -2,8 +2,8 @@
  * This code loads the necessary modules for the notifications overlay, not to 
be confused
  * with the Toast notifications defined by common/toast.js.
  */
-( function ( M, $ ) {
-       var Icon = M.require( 'Icon' ),
+( function ( M, $, mw ) {
+       var spinnerTemplate = mw.template.get( 'mobile.ajax', 'spinner.hogan' ),
                schema = M.require( 'loggingSchemas/MobileWebClickTracking' ),
                mainmenu = M.require( 'mainmenu' ),
                $btn = $( '#secondary-button.user-button' );
@@ -17,14 +17,13 @@
        */
        function loadModuleScript( moduleName ) {
                var d = $.Deferred(),
-                       loadingIcon = new Icon( {
-                               tagName: 'a',
-                               additionalClassNames: 'loading'
-                       } ).toHtmlString();
+                       spinner = spinnerTemplate.render();
 
-               $btn.hide().after( loadingIcon );
+               $btn.hide().after( spinner );
                mw.loader.using( moduleName, function () {
-                       $btn.next( '.loading' ).remove();
+                       // FIXME: Some code uses the loading class while other 
code uses the
+                       // spinner class. Make all code consistent so it's 
easier to change.
+                       $btn.next( '.spinner' ).remove();
                        $btn.show();
                        d.resolve();
                } );
@@ -68,4 +67,4 @@
                        } );
                } );
        } );
-}( mw.mobileFrontend, jQuery ) );
+}( mw.mobileFrontend, jQuery, mw ) );
diff --git a/less/ui.less b/less/ui.less
index 54adf68..1e44bb6 100644
--- a/less/ui.less
+++ b/less/ui.less
@@ -89,6 +89,11 @@
        .fulltext-search {
                margin: 0 3px 0 9px;
        }
+
+       .spinner {
+               display: table-cell;
+               width: 54px;
+       }
 }
 
 // Make search input more visible for users on small screens.

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I792c1aacafc075e86a0b060e2318e7e129c14182
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/MobileFrontend
Gerrit-Branch: master
Gerrit-Owner: Phuedx <[email protected]>

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

Reply via email to