Skip to content

Commit

Permalink
Items component model (#1959)
Browse files Browse the repository at this point in the history
* issue/1892: added notify subview suppoprt

#1892

* issue/1892: notify subview improvements

* issue/1892: improved readability

* issue/1892: removed imageready conditional

* add extra method to itemsComponentModel

* rename method to setActiveItem
  • Loading branch information
lc-thomasberger authored and moloko committed Feb 16, 2018
1 parent 74c196f commit f8fc7c3
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/core/js/models/itemsComponentModel.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ define([

toJSON: function() {
var json = _.clone(this.attributes);

json._items = this.get('_items').toJSON();

return json;
Expand Down Expand Up @@ -65,6 +64,11 @@ define([

resetActiveItems: function() {
this.get('_items').each(function(item) { item.toggleActive(false); });
},

setActiveItem: function(index) {
this.getActiveItem().toggleActive(false);
this.getItem(index).toggleActive(true);
}

});
Expand Down

0 comments on commit f8fc7c3

Please sign in to comment.