cms/app-client/app/controllers/application.js
changeset 126 e87a340711a4
parent 95 f7ab931581af
child 189 21b30ee23191
equal deleted inserted replaced
125:e550b10fe3ca 126:e87a340711a4
    10   detail: null,
    10   detail: null,
    11 
    11 
    12   currentId: null,
    12   currentId: null,
    13   currentItem: Ember.computed('currentId', function() {
    13   currentItem: Ember.computed('currentId', function() {
    14     Ember.$(".result-item").toggleClass("playing", false);
    14     Ember.$(".result-item").toggleClass("playing", false);
    15     Ember.$("#"+this.get('currentId')).toggleClass("playing", true);
       
    16     if (this.get('currentId') === null){
    15     if (this.get('currentId') === null){
    17       return null;
    16       return null;
    18     }
    17     }
       
    18     Ember.$("#"+this.get('currentId').replace( /(:|\.|\[|\]|,)/g, "\\$1" )).toggleClass("playing", true);
    19     return this.store.findRecord('document', this.get('currentId'));
    19     return this.store.findRecord('document', this.get('currentId'));
    20   }),
    20   }),
    21   modalItem: Ember.computed('detail', function() {
    21   modalItem: Ember.computed('detail', function() {
    22     return this.store.findRecord('document', this.get('detail'));
    22     return this.store.findRecord('document', this.get('detail'));
    23   }),
    23   }),
    81     },
    81     },
    82     play: function(item){
    82     play: function(item){
    83       this.set("currentId", item.id);
    83       this.set("currentId", item.id);
    84     },
    84     },
    85     showMore: function(item){
    85     showMore: function(item){
    86       if (Ember.$("#"+item.id).hasClass("show-more")){
    86       var domItem = Ember.$("#"+item.id.replace( /(:|\.|\[|\]|,)/g, "\\$1" ));
    87           Ember.$("#"+item.id).toggleClass("show-more", false);
    87       if (domItem.hasClass("show-more")){
       
    88           domItem.toggleClass("show-more", false);
    88       } else{
    89       } else{
    89         Ember.$(".result-item").toggleClass("show-more", false);
    90         Ember.$(".result-item").toggleClass("show-more", false);
    90         Ember.$("#"+item.id).toggleClass("show-more", true);
    91         domItem.toggleClass("show-more", true);
    91       }
    92       }
    92     },
    93     },
    93     toggleModal: function(item){
    94     toggleModal: function(item){
    94       if (typeof(item) !== 'undefined'){
    95       if (typeof(item) !== 'undefined'){
    95         this.set("detail", item.id);
    96         this.set("detail", item.id);