Browse Source

Merge pull request #1091 from ChenMachluf/develop

remove subgroup from subgroups list if there is no more items in the …
flowchartTest
Alex 9 years ago
parent
commit
dfd9114026
1 changed files with 6 additions and 1 deletions
  1. +6
    -1
      lib/timeline/component/Group.js

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

@ -401,9 +401,14 @@ Group.prototype.remove = function(item) {
if(item.data.subgroup !== undefined){ if(item.data.subgroup !== undefined){
var subgroup = this.subgroups[item.data.subgroup]; var subgroup = this.subgroups[item.data.subgroup];
if(subgroup){
if (subgroup){
var itemIndex = subgroup.items.indexOf(item); var itemIndex = subgroup.items.indexOf(item);
subgroup.items.splice(itemIndex,1); subgroup.items.splice(itemIndex,1);
if (!subgroup.items.length){
delete this.subgroups[item.data.subgroup];
this.subgroupIndex--;
}
this.orderSubgroups();
} }
} }
}; };

Loading…
Cancel
Save