Correct error when transitioning between thematiques tabs and others (bug #0025983) + correct scroll for themes
authorymh <ymh.work@gmail.com>
Fri, 03 Feb 2017 13:01:08 +0100
changeset 495 c71923e6fa2f
parent 494 9a7fea1642cc
child 496 a53762d61c06
Correct error when transitioning between thematiques tabs and others (bug #0025983) + correct scroll for themes
cms/app-client/app/components/sorting-component.js
cms/app-client/app/routes/tabs/langues.js
cms/app-client/app/routes/tabs/thematiques.js
cms/app-client/app/templates/tabs/thematiques.hbs
--- 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