|
@ -165,8 +165,15 @@ Group.prototype.redraw = function(range, margin, restack) { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
// reposition visible items vertically
|
|
|
// reposition visible items vertically
|
|
|
|
|
|
var customOrderedItems = null; |
|
|
if (this.itemSet.options.stack) { // TODO: ugly way to access options...
|
|
|
if (this.itemSet.options.stack) { // TODO: ugly way to access options...
|
|
|
stack.stack(this.visibleItems, margin, restack); |
|
|
|
|
|
|
|
|
if (typeof this.itemSet.options.order === 'function' || false) { |
|
|
|
|
|
customOrderedItems = this._getCustomOrderedItems(); |
|
|
|
|
|
stack.stack(customOrderedItems, margin, true); |
|
|
|
|
|
} |
|
|
|
|
|
else { |
|
|
|
|
|
stack.stack(this.visibleItems, margin, restack); |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
else { // no stacking
|
|
|
else { // no stacking
|
|
|
stack.nostack(this.visibleItems, margin, this.subgroups); |
|
|
stack.nostack(this.visibleItems, margin, this.subgroups); |
|
@ -483,6 +490,23 @@ Group.prototype._updateVisibleItems = function(orderedItems, oldVisibleItems, ra |
|
|
return visibleItems; |
|
|
return visibleItems; |
|
|
}; |
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
Group.prototype._getCustomOrderedItems = function () { |
|
|
|
|
|
var customOrderedItems = this.orderedItems.byStart.filter(function (item) { |
|
|
|
|
|
return item.height !== 0 || item.width !== 0; |
|
|
|
|
|
}); |
|
|
|
|
|
var me = this; |
|
|
|
|
|
|
|
|
|
|
|
customOrderedItems.sort(function (a, b) { |
|
|
|
|
|
return me.itemSet.options.order(a.data, b.data); |
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
customOrderedItems.forEach(function (item) { |
|
|
|
|
|
item.repositionX(); |
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
return customOrderedItems; |
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
Group.prototype._traceVisible = function (initialPos, items, visibleItems, visibleItemsLookup, breakCondition) { |
|
|
Group.prototype._traceVisible = function (initialPos, items, visibleItems, visibleItemsLookup, breakCondition) { |
|
|
var item; |
|
|
var item; |
|
|
var i; |
|
|
var i; |
|
|