vendor/assets/vis/timeline/stack.js in vis-rails-1.0.2 vs vendor/assets/vis/timeline/stack.js in vis-rails-2.0.0

- old
+ new

@@ -5,22 +5,22 @@ /** * Order items by their start data * @param {Item[]} items */ -stack.orderByStart = function orderByStart(items) { +stack.orderByStart = function(items) { items.sort(function (a, b) { return a.data.start - b.data.start; }); }; /** * Order items by their end date. If they have no end date, their start date * is used. * @param {Item[]} items */ -stack.orderByEnd = function orderByEnd(items) { +stack.orderByEnd = function(items) { items.sort(function (a, b) { var aTime = ('end' in a.data) ? a.data.end : a.data.start, bTime = ('end' in b.data) ? b.data.end : b.data.start; return aTime - bTime; @@ -36,11 +36,11 @@ * Margins between items and between items and the axis. * @param {boolean} [force=false] * If true, all items will be repositioned. If false (default), only * items having a top===null will be re-stacked */ -stack.stack = function _stack (items, margin, force) { +stack.stack = function(items, margin, force) { var i, iMax; if (force) { // reset top position of all items for (i = 0, iMax = items.length; i < iMax; i++) { @@ -81,11 +81,11 @@ * @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) { +stack.nostack = function(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; @@ -102,10 +102,10 @@ * marked colliding when they overlap or * when the margin between the two is smaller than * the requested margin. * @return {boolean} true if a and b collide, else false */ -stack.collision = function collision (a, b, margin) { +stack.collision = function(a, b, margin) { return ((a.left - margin) < (b.left + b.width) && (a.left + a.width + margin) > b.left && (a.top - margin) < (b.top + b.height) && (a.top + a.height + margin) > b.top); };