From 947b2aa63170056187eaaca02a5897f61e1e5923 Mon Sep 17 00:00:00 2001 From: Chen Machluf Date: Wed, 1 Jul 2015 11:40:23 +0300 Subject: [PATCH] Remove item from subgroups in Group remove method --- lib/timeline/component/Group.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/timeline/component/Group.js b/lib/timeline/component/Group.js index 226ebab6..51e32ee2 100644 --- a/lib/timeline/component/Group.js +++ b/lib/timeline/component/Group.js @@ -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); + } + } };