Correct error when transitioning between thematiques tabs and others (bug #0025983) + correct scroll for themes
--- a/cms/app-client/app/components/sorting-component.js Wed Feb 01 18:43:57 2017 +0100
+++ b/cms/app-client/app/components/sorting-component.js Fri Feb 03 13:01:08 2017 +0100
@@ -37,7 +37,7 @@
let more = this.get('more');
let self = this;
if(!more) {
- this.set('scrollHandler', this.$('ul').on('scroll', function(event) { Ember.run.throttle(self, function() { this.scrolling(event.target); }, 150); }));
+ this.set('scrollHandler', this.$('.tags').on('scroll', function(event) { Ember.run.throttle(self, function() { self.scrolling(event.target); }, 300); }));
} else {
this.$('ul').off('scroll', this.get('scrollHandler'));
}
@@ -45,7 +45,6 @@
filterObserver: Ember.observer('filter.date.[]', 'filter.discourse.[]', 'filter.language', 'filter.location', 'filter.theme.[]', function() {
this.set('more', true);
- this.sendAction('resetIndex');
}),
actions: {
--- a/cms/app-client/app/routes/tabs/langues.js Wed Feb 01 18:43:57 2017 +0100
+++ b/cms/app-client/app/routes/tabs/langues.js Fri Feb 03 13:01:08 2017 +0100
@@ -11,6 +11,6 @@
activate() {
this.get('player').set('window', false);
- }
+ },
});
--- a/cms/app-client/app/routes/tabs/thematiques.js Wed Feb 01 18:43:57 2017 +0100
+++ b/cms/app-client/app/routes/tabs/thematiques.js Fri Feb 03 13:01:08 2017 +0100
@@ -22,7 +22,6 @@
'sort': this.get('sort')
}));
promise.then(response => {
- console.log("MODEL", response, response.get('content'), response.get('meta').total);
this.set('themes', response.get('content'));
this.set('total', response.get('meta').total);
});
@@ -33,6 +32,11 @@
this.get('player').set('window', false);
},
+ filterObserver: Ember.observer('filter.date.[]', 'filter.discourse.[]', 'filter.language', 'filter.location', 'filter.theme.[]', function() {
+ this.set('index', 0);
+ this.refresh();
+ }),
+
actions: {
loadMore: function() {
@@ -54,16 +58,12 @@
});
},
- resetIndexQueryParams: function () {
- this.set('index', 0);
- this.refresh();
- },
-
setSortQueryparams: function (sort) {
this.set('sort', sort);
this.set('index', 0);
this.refresh();
- }
+ return false;
+ },
}
--- a/cms/app-client/app/templates/tabs/thematiques.hbs Wed Feb 01 18:43:57 2017 +0100
+++ b/cms/app-client/app/templates/tabs/thematiques.hbs Fri Feb 03 13:01:08 2017 +0100
@@ -3,6 +3,5 @@
themes=model
load='loadMore'
sort='setSortQueryparams'
- resetIndex='resetIndexQueryParams'
}}
</div>
\ No newline at end of file