--- a/cms/app-client/app/components/sorting-component.js Sat Oct 15 16:15:07 2016 +0530
+++ b/cms/app-client/app/components/sorting-component.js Sat Oct 15 20:02:09 2016 +0530
@@ -19,9 +19,11 @@
this.$('ul').on('scroll', Ember.run.bind(this, this.scrolling));
}),
scrolling: function(event) {
- if(Ember.$(event.target).scrollTop() + Ember.$(event.target).height() > Ember.$(event.target).get(0).scrollHeight - 50) {
- this.triggerAction({ action:'loadMore', target: this });
- Ember.$(event.target).off('scroll');
+ if(Ember.$(event.target).scrollTop() !== 0 ) {
+ if(Ember.$(event.target).scrollTop() + Ember.$(event.target).height() > Ember.$(event.target).get(0).scrollHeight - 50) {
+ this.triggerAction({ action:'loadMore', target: this });
+ Ember.$(event.target).off('scroll');
+ }
}
},
--- a/cms/app-client/app/routes/tabs/thematiques.js Sat Oct 15 16:15:07 2016 +0530
+++ b/cms/app-client/app/routes/tabs/thematiques.js Sat Oct 15 20:02:09 2016 +0530
@@ -29,6 +29,10 @@
controller.set('themes', this.get('themes'));
},
+ deactivate: function () {
+ this.set('themes', []);
+ },
+
actions: {
setIndexQueryparams: function() {
@@ -37,11 +41,15 @@
setSortQueryparams: function(sort) {
this.set('sort', sort);
- this.get('themes').replaceContent(0, this.get('themes').get('content').length, null);
- // Force property reset to trigger request.
- this.propertyWillChange('index');
- this.set('index', 0);
- this.propertyDidChange('index');
+ this.get('themes').get('content').clear();
+ if(this.get('index') === 0) {
+ // Force property reset to trigger request
+ this.propertyWillChange('index');
+ this.set('index', 0);
+ this.propertyDidChange('index');
+ } else {
+ this.set('index', 0);
+ }
}
}