Quickfix this is undefined
authorChloe Laisne <chloe.laisne@gmail.com>
Thu, 23 Jun 2016 17:22:57 +0200
changeset 201 9ae2cf79d167
parent 200 a441c40f9c5e
child 202 0446e07981db
Quickfix this is undefined
cms/app-client/app/components/playlist-component.js
cms/app-client/app/routes/application.js
--- a/cms/app-client/app/components/playlist-component.js	Thu Jun 23 17:09:32 2016 +0200
+++ b/cms/app-client/app/components/playlist-component.js	Thu Jun 23 17:22:57 2016 +0200
@@ -7,11 +7,12 @@
 	filter: Ember.inject.service(),
 
 	documents: Ember.computed('model', 'filter.location', 'filter.language', 'filter.discourse', 'filter.date', 'filter.theme', function() {
+        var self = this;
         var documents = this.get('model');
         if (this.get('filter.date').length > 0) {
             var copy = documents;
             documents.map(function(document) {
-                if (this.get('filter.date').indexOf(document.get('created')) === -1){
+                if (self.get('filter.date').indexOf(document.get('created')) === -1){
                     copy = copy.without(document);
                 }
             });
--- a/cms/app-client/app/routes/application.js	Thu Jun 23 17:09:32 2016 +0200
+++ b/cms/app-client/app/routes/application.js	Thu Jun 23 17:22:57 2016 +0200
@@ -2,7 +2,7 @@
 
 export default Ember.Route.extend({
 
-    model() {
+    model: function() {
         return this.store.findAll('document');
     },