Browse Source

Merge pull request #1049 from ChenMachluf/develop

Remove item from subgroups in Group remove method
flowchartTest
Alex 9 years ago
parent
commit
76b27b506e
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