jenkins-bot has submitted this change and it was merged.
Change subject: Hygiene: Consolidate ajax loading code
......................................................................
Hygiene: Consolidate ajax loading code
Remove from talk icon which uses the LoadingOverlay
Instead of introducing a specific rule for photo uploads, use
JavaScript to control this behaviour
Change-Id: I9c645104b2bb15867300eb6c623b4add2ea354cf
---
M javascripts/modules/mediaViewer.js
M less/common/common-js.less
M less/modules/mediaViewer.less
M less/modules/talk.less
M less/modules/uploads.less
M templates/modules/ImageOverlay.html
6 files changed, 6 insertions(+), 16 deletions(-)
Approvals:
JGonera: Looks good to me, approved
jenkins-bot: Verified
diff --git a/javascripts/modules/mediaViewer.js
b/javascripts/modules/mediaViewer.js
index ddf31ac..1eeecbc 100644
--- a/javascripts/modules/mediaViewer.js
+++ b/javascripts/modules/mediaViewer.js
@@ -51,14 +51,15 @@
},
postRender: function( options ) {
- var self = this;
+ var self = this, $img;
this._super( options );
api.getThumb( options.title ).done( function( data ) {
self.imgRatio = data.thumbwidth /
data.thumbheight;
self.$( '.container' ).removeClass( 'loading' );
- self.$( 'img' ).attr( 'src', data.thumburl );
+ $img = $( '<img>' ).attr( 'src', data.thumburl
).attr( 'alt', options.caption );
+ self.$( '.container div' ).append( $img );
self._positionImage();
self.$( '.details a' ).attr( 'href',
data.descriptionurl );
diff --git a/less/common/common-js.less b/less/common/common-js.less
index 99fb3e0..ca3b391 100644
--- a/less/common/common-js.less
+++ b/less/common/common-js.less
@@ -6,12 +6,13 @@
}
.loading {
+
&.spinner {
height: 100px;
}
// needs !important to override images from more specific rules
- background-image: url(images/ajax-loader.gif) !important;
+ background-image: @ajaxLoadingImage !important;
background-repeat: no-repeat;
background-position: center;
.background-size( 32px, auto );
diff --git a/less/modules/mediaViewer.less b/less/modules/mediaViewer.less
index 1881b5e..4aa33c5 100644
--- a/less/modules/mediaViewer.less
+++ b/less/modules/mediaViewer.less
@@ -18,10 +18,6 @@
}
}
- .loading img {
- display: none;
- }
-
img {
// get rid of a small bottom margin and vertical scrollbar
vertical-align: bottom;
diff --git a/less/modules/talk.less b/less/modules/talk.less
index bb658e6..d85642e 100644
--- a/less/modules/talk.less
+++ b/less/modules/talk.less
@@ -10,10 +10,6 @@
padding-left: 4px;
font-size: 9px; // FIXME: use pixels for time being as the icon
in pixels.
}
-
- &.loading a {
- display: none;
- }
}
.mw-mf-overlay .header {
diff --git a/less/modules/uploads.less b/less/modules/uploads.less
index 5b525f3..ba23051 100644
--- a/less/modules/uploads.less
+++ b/less/modules/uploads.less
@@ -89,10 +89,6 @@
height: 50%;
.background-size( 100%, auto );
background-repeat: no-repeat;
-
- &.loading {
- .background-size( 32px, auto );
- }
}
li {
diff --git a/templates/modules/ImageOverlay.html
b/templates/modules/ImageOverlay.html
index 31d1e72..779b948 100644
--- a/templates/modules/ImageOverlay.html
+++ b/templates/modules/ImageOverlay.html
@@ -1,5 +1,5 @@
<button class="cancel">{{closeMsg}}</button>
-<div class="container loading"><div><img alt="{{caption}}"></div></div>
+<div class="container loading"><div></div></div>
<p class="content details">
<a class="button" href="#">{{detailsMsg}}</a>
{{caption}}
--
To view, visit https://gerrit.wikimedia.org/r/91988
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I9c645104b2bb15867300eb6c623b4add2ea354cf
Gerrit-PatchSet: 6
Gerrit-Project: mediawiki/extensions/MobileFrontend
Gerrit-Branch: master
Gerrit-Owner: Jdlrobson <[email protected]>
Gerrit-Reviewer: JGonera <[email protected]>
Gerrit-Reviewer: Jdlrobson <[email protected]>
Gerrit-Reviewer: jenkins-bot
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits