|
@ -2488,14 +2488,14 @@ stack.orderByEnd = function orderByEnd(items) { |
|
|
}; |
|
|
}; |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
* Adjust vertical positions of the events such that they don't overlap each |
|
|
|
|
|
|
|
|
* Adjust vertical positions of the items such that they don't overlap each |
|
|
* other. |
|
|
* other. |
|
|
* @param {Item[]} items |
|
|
* @param {Item[]} items |
|
|
* All visible items |
|
|
* All visible items |
|
|
* @param {{item: number, axis: number}} margin |
|
|
* @param {{item: number, axis: number}} margin |
|
|
* Margins between items and between items and the axis. |
|
|
* Margins between items and between items and the axis. |
|
|
* @param {boolean} [force=false] |
|
|
* @param {boolean} [force=false] |
|
|
* If true, all items will be re-stacked. If false (default), only |
|
|
|
|
|
|
|
|
* If true, all items will be repositioned. If false (default), only |
|
|
* items having a top===null will be re-stacked |
|
|
* items having a top===null will be re-stacked |
|
|
*/ |
|
|
*/ |
|
|
stack.stack = function _stack (items, margin, force) { |
|
|
stack.stack = function _stack (items, margin, force) { |
|
@ -2528,7 +2528,7 @@ stack.stack = function _stack (items, margin, force) { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
if (collidingItem != null) { |
|
|
if (collidingItem != null) { |
|
|
// There is a collision. Reposition the event above the colliding element
|
|
|
|
|
|
|
|
|
// There is a collision. Reposition the items above the colliding element
|
|
|
item.top = collidingItem.top + collidingItem.height + margin.item; |
|
|
item.top = collidingItem.top + collidingItem.height + margin.item; |
|
|
} |
|
|
} |
|
|
} while (collidingItem); |
|
|
} while (collidingItem); |
|
@ -2536,6 +2536,22 @@ stack.stack = function _stack (items, margin, force) { |
|
|
} |
|
|
} |
|
|
}; |
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
* Adjust vertical positions of the items without stacking them |
|
|
|
|
|
* @param {Item[]} items |
|
|
|
|
|
* All visible items |
|
|
|
|
|
* @param {{item: number, axis: number}} margin |
|
|
|
|
|
* Margins between items and between items and the axis. |
|
|
|
|
|
*/ |
|
|
|
|
|
stack.nostack = function nostack (items, margin) { |
|
|
|
|
|
var i, iMax; |
|
|
|
|
|
|
|
|
|
|
|
// reset top position of all items
|
|
|
|
|
|
for (i = 0, iMax = items.length; i < iMax; i++) { |
|
|
|
|
|
items[i].top = margin.axis; |
|
|
|
|
|
} |
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
* Test if the two provided items collide |
|
|
* Test if the two provided items collide |
|
|
* The items must have parameters left, width, top, and height. |
|
|
* The items must have parameters left, width, top, and height. |
|
@ -5405,6 +5421,8 @@ ItemSet.prototype._onRemoveGroups = function _onRemoveGroups(ids) { |
|
|
} |
|
|
} |
|
|
}); |
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
this.markDirty(); |
|
|
|
|
|
|
|
|
this.emit('change'); |
|
|
this.emit('change'); |
|
|
}; |
|
|
}; |
|
|
|
|
|
|
|
@ -6795,7 +6813,12 @@ Group.prototype.repaint = function repaint(range, margin, restack) { |
|
|
this.visibleItems = this._updateVisibleItems(this.orderedItems, this.visibleItems, range); |
|
|
this.visibleItems = this._updateVisibleItems(this.orderedItems, this.visibleItems, range); |
|
|
|
|
|
|
|
|
// reposition visible items vertically
|
|
|
// reposition visible items vertically
|
|
|
stack.stack(this.visibleItems, margin, restack); |
|
|
|
|
|
|
|
|
if (this.itemSet.options.stack) { // TODO: ugly way to access options...
|
|
|
|
|
|
stack.stack(this.visibleItems, margin, restack); |
|
|
|
|
|
} |
|
|
|
|
|
else { // no stacking
|
|
|
|
|
|
stack.nostack(this.visibleItems, margin); |
|
|
|
|
|
} |
|
|
this.stackDirty = false; |
|
|
this.stackDirty = false; |
|
|
for (var i = 0, ii = this.visibleItems.length; i < ii; i++) { |
|
|
for (var i = 0, ii = this.visibleItems.length; i < ii; i++) { |
|
|
var item = this.visibleItems[i]; |
|
|
var item = this.visibleItems[i]; |
|
@ -7135,6 +7158,7 @@ function Timeline (container, items, options) { |
|
|
orientation: 'bottom', |
|
|
orientation: 'bottom', |
|
|
direction: 'horizontal', // 'horizontal' or 'vertical'
|
|
|
direction: 'horizontal', // 'horizontal' or 'vertical'
|
|
|
autoResize: true, |
|
|
autoResize: true, |
|
|
|
|
|
stacking: true, |
|
|
|
|
|
|
|
|
editable: { |
|
|
editable: { |
|
|
updateTime: false, |
|
|
updateTime: false, |
|
|