cms/app-client/app/components/playlist-component.js
changeset 201 9ae2cf79d167
parent 200 a441c40f9c5e
child 209 35cb7200bb0a
equal deleted inserted replaced
200:a441c40f9c5e 201:9ae2cf79d167
     5 	classNames: ['playlist-component'],
     5 	classNames: ['playlist-component'],
     6 
     6 
     7 	filter: Ember.inject.service(),
     7 	filter: Ember.inject.service(),
     8 
     8 
     9 	documents: Ember.computed('model', 'filter.location', 'filter.language', 'filter.discourse', 'filter.date', 'filter.theme', function() {
     9 	documents: Ember.computed('model', 'filter.location', 'filter.language', 'filter.discourse', 'filter.date', 'filter.theme', function() {
       
    10         var self = this;
    10         var documents = this.get('model');
    11         var documents = this.get('model');
    11         if (this.get('filter.date').length > 0) {
    12         if (this.get('filter.date').length > 0) {
    12             var copy = documents;
    13             var copy = documents;
    13             documents.map(function(document) {
    14             documents.map(function(document) {
    14                 if (this.get('filter.date').indexOf(document.get('created')) === -1){
    15                 if (self.get('filter.date').indexOf(document.get('created')) === -1){
    15                     copy = copy.without(document);
    16                     copy = copy.without(document);
    16                 }
    17                 }
    17             });
    18             });
    18             documents = copy;
    19             documents = copy;
    19         }
    20         }