Browse Source

Add check for empty groupIds array and get full list from data set. Fixes #2877 (#2986)

gemini
Ben Morton 7 years ago
committed by yotamberk
parent
commit
0ae676c424
1 changed files with 10 additions and 2 deletions
  1. +10
    -2
      lib/timeline/component/ItemSet.js

+ 10
- 2
lib/timeline/component/ItemSet.js View File

@ -2233,8 +2233,16 @@ ItemSet.prototype.itemFromRelatedTarget = function(event) {
*/
ItemSet.prototype.groupFromTarget = function(event) {
var clientY = event.center ? event.center.y : event.clientY;
for (var i = 0; i < this.groupIds.length; i++) {
var groupId = this.groupIds[i];
var groupIds = this.groupIds;
if (groupIds.length <= 0) {
groupIds = this.groupsData.getIds({
order: this.options.groupOrder
});
}
for (var i = 0; i < groupIds.length; i++) {
var groupId = groupIds[i];
var group = this.groups[groupId];
var foreground = group.dom.foreground;
var top = util.getAbsoluteTop(foreground);

Loading…
Cancel
Save