Skip to content
This repository was archived by the owner on May 16, 2019. It is now read-only.

Commit dd772ae

Browse files
committed
update spinners
1 parent db7e90e commit dd772ae

File tree

2 files changed

+15
-14
lines changed

2 files changed

+15
-14
lines changed

js/templates/settings.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -729,7 +729,7 @@ <h3 class="padding15 margin0 fontWeight500"><%= polyglot.t('Basic') %></h3>
729729
<div class="flexCol-9 borderRight0 custCol-border">
730730
<div class="hideTopAndBottomBorder js-settingsCurrentMods">
731731
</div>
732-
<div class="padding10 width100 alignCenter fadeable js-loadingMsg">
732+
<div class="padding10 width100 alignCenter fadeable js-loadingMsgOld">
733733
<i class="ion-android-sync spinner textSize24px textOpacity50"></i>
734734
</div>
735735
</div>
@@ -750,7 +750,7 @@ <h3 class="padding15 margin0 fontWeight500"><%= polyglot.t('Basic') %></h3>
750750
<div class="flexCol-9 borderRight0 custCol-border">
751751
<div class="hideTopAndBottomBorder js-settingsNewMods">
752752
</div>
753-
<div class="padding10 width100 alignCenter fadeable js-loadingMsg">
753+
<div class="padding10 width100 alignCenter fadeable js-loadingMsgNew">
754754
<i class="ion-android-sync spinner textSize24px textOpacity50"></i>
755755
</div>
756756
</div>

js/views/settingsVw.js

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -503,9 +503,21 @@ module.exports = Backbone.View.extend({
503503
//don't add unless it comes from the model
504504
if(moderator.fromModel){
505505
this.$el.find('.js-settingsCurrentMods').append(modShort.el);
506+
if(!this.$('.js-loadingMsgOld').hasClass('foldIn')){
507+
//hide spinners after a while
508+
setTimeout(()=> {
509+
this.$('.js-loadingMsgOld').addClass('foldIn');
510+
},2000);
511+
}
506512
}
507513
}else{
508514
this.$el.find('.js-settingsNewMods').append(modShort.el);
515+
if(!this.$('.js-loadingMsgNew').hasClass('foldIn')){
516+
//hide spinners after a while
517+
setTimeout(()=> {
518+
this.$('.js-loadingMsgNew').addClass('foldIn');
519+
},2000);
520+
}
509521
}
510522
this.moderatorCount++;
511523
this.subViews.push(modShort);
@@ -557,10 +569,6 @@ module.exports = Backbone.View.extend({
557569
}
558570
});
559571
}
560-
//hide spinners after a while
561-
setTimeout(()=> {
562-
this.$('.js-loadingMsg').addClass('foldIn');
563-
},3000);
564572
this.firstLoadModerators = false;
565573
} else if (state === 'blocked') {
566574
// Since the Blocked Users View kicks off many server calls (one
@@ -819,23 +827,18 @@ module.exports = Backbone.View.extend({
819827

820828
$saveBtn.addClass('loading');
821829

822-
console.log(moderatorList)
823-
824830
//first, remove any existing moderators that have been unchecked. This prevents removing saved moderators that don't show up in the UI for some reason
825831
moderatorsUnChecked.each(function() {
826832
moderatorList = __.without(moderatorList, ($(this).data('guid')));
827833
});
828834

829-
console.log(moderatorList)
830-
831835
//add any new moderators that have been checked
832836
moderatorsNew.each(function() {
833837
moderatorList.push($(this).data('guid'));
834838
});
835-
839+
836840
//add any manually entered mods
837841
manualModList = this.$('#addManualMods').val().split(',');
838-
console.log(manualModList);
839842
__.each(manualModList, function(mod){
840843
if(mod.length === 40){
841844
moderatorList.push(mod);
@@ -850,8 +853,6 @@ module.exports = Backbone.View.extend({
850853
messageModal.show(window.polyglot.t('errorMessages.saveError'), data.reason);
851854
};
852855

853-
return;
854-
855856
saveToAPI(form, "", self.serverUrl + "profile", function() {
856857
saveToAPI(form, self.userModel.toJSON(), self.serverUrl + "settings",
857858
function () {

0 commit comments

Comments
 (0)