cms/app-client/app/controllers/application.js
changeset 89 89be68e13215
parent 88 1547a32aef60
child 91 acfeddc7821d
equal deleted inserted replaced
88:1547a32aef60 89:89be68e13215
    46     Ember.$(".result-item").toggleClass("playing", false);
    46     Ember.$(".result-item").toggleClass("playing", false);
    47     Ember.$("#"+this.get('currentItem').id).toggleClass("playing", true);
    47     Ember.$("#"+this.get('currentItem').id).toggleClass("playing", true);
    48   }),
    48   }),
    49   actions: {
    49   actions: {
    50     deleteTag: function(query, item){
    50     deleteTag: function(query, item){
    51       var queryParams = {},
    51       var newParams = null;
    52           newParams = null;
    52 
    53       if (query === 'date'){
    53       if (query === 'date'){
    54         newParams = this.get('date');
    54         newParams = [];
    55         if(newParams.indexOf(item) !== -1) {
    55         Ember.$.each(this.get('date'), function(index, elt){
    56         	newParams = newParams.splice(newParams.indexOf(item), 1);
    56           if (elt !== item){
    57         }
    57             newParams.push(elt);
       
    58           }
       
    59         });
    58       }
    60       }
    59       queryParams[query] = newParams;
    61 
    60       this.transitionToRoute({queryParams: queryParams});
    62       this.set(query, newParams);
    61     },
    63     },
    62     changeSong: function(songDirection){
    64     changeSong: function(songDirection){
    63       var direction = (songDirection === "next") ? 1 : -1;
    65       var direction = (songDirection === "next") ? 1 : -1;
    64       var index = this.get("filteredSounds").indexOf(this.get("currentItem"));
    66       var index = this.get("filteredSounds").indexOf(this.get("currentItem"));
    65       if ( index !== -1){
    67       if ( index !== -1){