Browse Source

Remove item from subgroups in Group remove method

flowchartTest
Chen Machluf 9 years ago
parent
commit
947b2aa631
1 changed files with 7 additions and 1 deletions
  1. +7
    -1
      lib/timeline/component/Group.js

+ 7
- 1
lib/timeline/component/Group.js View File

@ -388,7 +388,13 @@ Group.prototype.remove = function(item) {
var index = this.visibleItems.indexOf(item);
if (index != -1) this.visibleItems.splice(index, 1);
// TODO: also remove from ordered items?
if(item.data.subgroup !== undefined){
var subgroup = this.subgroups[item.data.subgroup];
if(subgroup){
var itemIndex = subgroup.items.indexOf(item);
subgroup.items.splice(itemIndex,1);
}
}
};

Loading…
Cancel
Save