mirror of
https://github.com/discourse/discourse.git
synced 2025-03-06 11:19:51 +00:00
Merge pull request #2211 from velesin/delayed_tab_switch_spinner
Delays loading spinner when switching between tabs.
This commit is contained in:
commit
08917e71bd
@ -10,11 +10,18 @@
|
||||
Discourse.DiscoveryRoute = Discourse.Route.extend(Discourse.OpenComposer, {
|
||||
actions: {
|
||||
loading: function() {
|
||||
this.controllerFor('discovery').set('loading', true);
|
||||
var controller = this.controllerFor('discovery');
|
||||
|
||||
controller.set('scheduledSpinner', Ember.run.later(controller, function() {
|
||||
this.set('loading', true);
|
||||
},500));
|
||||
},
|
||||
|
||||
loadingComplete: function() {
|
||||
this.controllerFor('discovery').set('loading', false);
|
||||
var controller = this.controllerFor('discovery');
|
||||
|
||||
Ember.run.cancel(controller.get('scheduledSpinner'));
|
||||
controller.set('loading', false);
|
||||
},
|
||||
|
||||
didTransition: function() {
|
||||
|
Loading…
x
Reference in New Issue
Block a user