From dc4da6b013e04b000dadb27a7a1c3151ba451149 Mon Sep 17 00:00:00 2001 From: Robin Ward Date: Tue, 11 Nov 2014 14:58:00 -0500 Subject: [PATCH] UX: Don't delay spinner on topic lists or clicking home --- .../discourse/controllers/discovery.js.es6 | 2 -- .../discourse/routes/discovery_route.js | 6 +--- .../discourse/templates/discovery.hbs | 36 +++++++++---------- 3 files changed, 19 insertions(+), 25 deletions(-) diff --git a/app/assets/javascripts/discourse/controllers/discovery.js.es6 b/app/assets/javascripts/discourse/controllers/discovery.js.es6 index 8f012b42fac..68ac68f45fb 100644 --- a/app/assets/javascripts/discourse/controllers/discovery.js.es6 +++ b/app/assets/javascripts/discourse/controllers/discovery.js.es6 @@ -4,8 +4,6 @@ import TopPeriod from 'discourse/models/top-period'; export default ObjectController.extend({ needs: ['navigation/category', 'discovery/topics'], loading: false, - loadingSpinner: false, - scheduledSpinner: null, category: Em.computed.alias('controllers.navigation/category.category'), noSubcategories: Em.computed.alias('controllers.navigation/category.noSubcategories'), diff --git a/app/assets/javascripts/discourse/routes/discovery_route.js b/app/assets/javascripts/discourse/routes/discovery_route.js index 27f6d49c0a5..2c0f5d993f1 100644 --- a/app/assets/javascripts/discourse/routes/discovery_route.js +++ b/app/assets/javascripts/discourse/routes/discovery_route.js @@ -26,15 +26,11 @@ Discourse.DiscoveryRoute = Discourse.Route.extend(Discourse.ScrollTop, Discourse if (controller.get('loading')) { return; } controller.set('loading', true); - controller.set('scheduledSpinner', Ember.run.later(controller, function() { - this.set('loadingSpinner', true); - },500)); }, loadingComplete: function() { var controller = this.controllerFor('discovery'); - Ember.run.cancel(controller.get('scheduledSpinner')); - controller.setProperties({ loading: false, loadingSpinner: false }); + controller.set('loading', false); if (!Discourse.Session.currentProp('topicListScrollPosition')) { this._scrollTop(); } diff --git a/app/assets/javascripts/discourse/templates/discovery.hbs b/app/assets/javascripts/discourse/templates/discovery.hbs index 4a7fdb68ae0..32daec93867 100644 --- a/app/assets/javascripts/discourse/templates/discovery.hbs +++ b/app/assets/javascripts/discourse/templates/discovery.hbs @@ -10,26 +10,26 @@ -{{#if loadingSpinner}} +{{#if loading}} {{loading-spinner}} -{{else}} -
-
-
-
- {{outlet header-list-container}} -
-
-
-
-
-
- {{outlet list-container}} -
+{{/if}} + +
+
+
+
+ {{outlet header-list-container}}
- {{#if loadedAllItems}} - {{custom-html "footer"}} - {{/if}} +
+
+
+ {{outlet list-container}} +
+
+
+
+{{#if loadedAllItems}} + {{custom-html "footer"}} {{/if}}