UX: Don't delay spinner on topic lists or clicking home

This commit is contained in:
Robin Ward 2014-11-11 14:58:00 -05:00
parent 2431ca5e25
commit dc4da6b013
3 changed files with 19 additions and 25 deletions

View File

@ -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'),

View File

@ -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();
}

View File

@ -10,26 +10,26 @@
</div>
</div>
{{#if loadingSpinner}}
{{#if loading}}
{{loading-spinner}}
{{else}}
<div {{bind-attr class=":container :list-container loadingSpinner:hidden"}}>
<div class="row">
<div class="full-width">
<div id='header-list-area'>
{{outlet header-list-container}}
</div>
</div>
</div>
<div class="row">
<div class="full-width">
<div id='list-area'>
{{outlet list-container}}
</div>
{{/if}}
<div {{bind-attr class=":container :list-container loading:hidden"}}>
<div class="row">
<div class="full-width">
<div id='header-list-area'>
{{outlet header-list-container}}
</div>
</div>
</div>
{{#if loadedAllItems}}
{{custom-html "footer"}}
{{/if}}
<div class="row">
<div class="full-width">
<div id='list-area'>
{{outlet list-container}}
</div>
</div>
</div>
</div>
{{#if loadedAllItems}}
{{custom-html "footer"}}
{{/if}}