jenkins-bot has submitted this change and it was merged.
Change subject: (Bug 45559) Clicking group selector does nothing until data is
loaded
......................................................................
(Bug 45559) Clicking group selector does nothing until data is loaded
Change-Id: Iff833d51e3c893fca8e3e707589bf2971bf3752d
---
M Resources.php
M resources/css/ext.translate.groupselector.css
A resources/css/ext.translate.loader.css
M resources/css/ext.translate.messagetable.css
M resources/js/ext.translate.groupselector.js
5 files changed, 61 insertions(+), 41 deletions(-)
Approvals:
Siebrand: Looks good to me, approved
jenkins-bot: Verified
diff --git a/Resources.php b/Resources.php
index 69d5d15..c34acd7 100644
--- a/Resources.php
+++ b/Resources.php
@@ -95,6 +95,12 @@
'position' => 'top',
) + $resourcePaths;
+$wgResourceModules['ext.translate.loader'] = array(
+ 'styles' => 'resources/css/ext.translate.loader.css',
+ 'position' => 'top',
+) + $resourcePaths;
+
+
$wgResourceModules['ext.translate.groupselector'] = array(
'styles' => 'resources/css/ext.translate.groupselector.css',
'scripts' => 'resources/js/ext.translate.groupselector.js',
@@ -103,6 +109,7 @@
'ext.translate.grid',
'ext.translate.statsbar',
'mediawiki.jqueryMsg',
+ 'ext.translate.loader',
),
'messages' => array(
'translate-msggroupselector-projects',
@@ -132,6 +139,7 @@
'jquery.appear',
'mediawiki.jqueryMsg',
'ext.translate.parsers',
+ 'ext.translate.loader',
),
'messages' => array(
'translate-messagereview-submit',
diff --git a/resources/css/ext.translate.groupselector.css
b/resources/css/ext.translate.groupselector.css
index eb41318..10b3666 100644
--- a/resources/css/ext.translate.groupselector.css
+++ b/resources/css/ext.translate.groupselector.css
@@ -248,3 +248,9 @@
min-height: 1px;
position: relative;
}
+
+.ext-translate-msggroup-selector-menu .tux-loading-indicator {
+ top: 50%;
+ left: 50%;
+ position: absolute;
+}
\ No newline at end of file
diff --git a/resources/css/ext.translate.loader.css
b/resources/css/ext.translate.loader.css
new file mode 100644
index 0000000..8913c7f
--- /dev/null
+++ b/resources/css/ext.translate.loader.css
@@ -0,0 +1,40 @@
+
+/* Loading indicator: */
+
+@-webkit-keyframes tux-loading-indicator-spin {
+ from {
+ -webkit-transform: rotate(0deg);
+ }
+ to {
+ -webkit-transform: rotate(360deg);
+ }
+}
+
+@keyframes tux-loading-indicator-spin {
+ from {
+ transform: rotate(0deg);
+ }
+ to {
+ transform: rotate(360deg);
+ }
+}
+
+.tux-loading-indicator {
+ float: left;
+ background: transparent url(../images/loading.gif) right bottom
no-repeat;
+ background-image: -webkit-linear-gradient(transparent, transparent),
url(../images/loading.svg);
+ background-image: -moz-linear-gradient(transparent, transparent),
url(../images/loading.svg);
+ background-image: linear-gradient(transparent, transparent),
url(../images/loading.svg);
+ background-size: 100%;
+ -webkit-animation-name: tux-loading-indicator-spin;
+ -webkit-animation-duration: 1.5s;
+ -webkit-animation-iteration-count: infinite;
+ -webkit-animation-timing-function: linear;
+ animation-name: tux-loading-indicator-spin;
+ animation-duration: 1.5s;
+ animation-iteration-count: infinite;
+ animation-timing-function: linear;
+ height: 34px;
+ width: 34px;
+ backface-visibility: hidden;
+}
\ No newline at end of file
diff --git a/resources/css/ext.translate.messagetable.css
b/resources/css/ext.translate.messagetable.css
index b136c2f..68dee9d 100644
--- a/resources/css/ext.translate.messagetable.css
+++ b/resources/css/ext.translate.messagetable.css
@@ -285,46 +285,6 @@
background: #252525;
}
-/* Loading indicator: */
-
-@-webkit-keyframes tux-loading-indicator-spin {
- from {
- -webkit-transform: rotate(0deg);
- }
- to {
- -webkit-transform: rotate(360deg);
- }
-}
-
-@keyframes tux-loading-indicator-spin {
- from {
- transform: rotate(0deg);
- }
- to {
- transform: rotate(360deg);
- }
-}
-
-.tux-loading-indicator {
- float: left;
- background: transparent url(../images/loading.gif) right bottom
no-repeat;
- background-image: -webkit-linear-gradient(transparent, transparent),
url(../images/loading.svg);
- background-image: -moz-linear-gradient(transparent, transparent),
url(../images/loading.svg);
- background-image: linear-gradient(transparent, transparent),
url(../images/loading.svg);
- background-size: 100%;
- -webkit-animation-name: tux-loading-indicator-spin;
- -webkit-animation-duration: 1.5s;
- -webkit-animation-iteration-count: infinite;
- -webkit-animation-timing-function: linear;
- animation-name: tux-loading-indicator-spin;
- animation-duration: 1.5s;
- animation-iteration-count: infinite;
- animation-timing-function: linear;
- height: 34px;
- width: 34px;
- backface-visibility: hidden;
-}
-
.ext-translate-container .tux-messagelist .tux-message-filter-result {
color: #252525;
line-height: 40px;
diff --git a/resources/js/ext.translate.groupselector.js
b/resources/js/ext.translate.groupselector.js
index 95ca953..63136bf 100644
--- a/resources/js/ext.translate.groupselector.js
+++ b/resources/js/ext.translate.groupselector.js
@@ -39,6 +39,7 @@
$search,
$searchIcon,
$searchGroup,
+ $loader,
$msgGroupList;
this.$menu = $( '<div
class="ext-translate-msggroup-selector-menu grid">' );
@@ -84,7 +85,8 @@
$msgGroupList = $( '<div>' )
.addClass( 'row ext-translate-msggroup-list' );
- this.$menu.append( $groupTitle, $listFiltersGroup,
$msgGroupList );
+ $loader = $( '<div>' ).addClass(
'tux-loading-indicator' );
+ this.$menu.append( $groupTitle, $listFiltersGroup,
$loader, $msgGroupList );
$( 'body' ).append( this.$menu );
},
@@ -252,6 +254,7 @@
*/
getRecentGroups: function () {
var api = new mw.Api(),
+ groupSelector = this,
messageGroups = this.$menu.data( 'msggroups' ),
$msgGroupList = this.$menu.find(
'.ext-translate-msggroup-list' ),
recentMessageGroups = $(
'.ext-translate-msggroup-selector' )
@@ -276,6 +279,7 @@
if ( recentMessageGroups ) {
addRecentMessageGroups( recentMessageGroups );
} else {
+ groupSelector.$menu.find(
'.tux-loading-indicator' ).show();
api.get( {
action: 'translateuser',
format: 'json'
@@ -283,6 +287,7 @@
$( '.ext-translate-msggroup-selector' )
.data( 'recentmsggroups',
result.translateuser.recentgroups );
addRecentMessageGroups(
result.translateuser.recentgroups );
+ groupSelector.$menu.find(
'.tux-loading-indicator' ).hide();
} );
}
},
@@ -437,6 +442,7 @@
} else {
$msgGroupList.append( $msgGroupRows );
}
+ this.$menu.find( '.tux-loading-indicator' ).hide();
},
/**
--
To view, visit https://gerrit.wikimedia.org/r/53970
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: Iff833d51e3c893fca8e3e707589bf2971bf3752d
Gerrit-PatchSet: 6
Gerrit-Project: mediawiki/extensions/Translate
Gerrit-Branch: master
Gerrit-Owner: Santhosh <[email protected]>
Gerrit-Reviewer: Amire80 <[email protected]>
Gerrit-Reviewer: Nikerabbit <[email protected]>
Gerrit-Reviewer: Pginer <[email protected]>
Gerrit-Reviewer: Santhosh <[email protected]>
Gerrit-Reviewer: Siebrand <[email protected]>
Gerrit-Reviewer: jenkins-bot
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits