diff --git a/HISTORY.md b/HISTORY.md index 2f200915..34342e3a 100644 --- a/HISTORY.md +++ b/HISTORY.md @@ -19,6 +19,7 @@ http://visjs.org - Implemented animated range change for functions `fit`, `focus`, `setSelection`, and `setWindow`. - Implemented functions `setCurrentTime(date)` and `getCurrentTime()`. +- Implemented a new callback function `onMoving(item, callback)`. - Fixed the `change` event sometimes being fired twice on IE10. - Fixed canceling moving an item to another group did not move the item back to the original group. diff --git a/docs/timeline.html b/docs/timeline.html index 7f556d14..4230caaa 100644 --- a/docs/timeline.html +++ b/docs/timeline.html @@ -1030,6 +1030,7 @@ var options = {
onAdd(item, callback)
Fired when a new item is about to be added. If not implemented, the item will be added with default text contents.onUpdate(item, callback)
Fired when an item is about to be updated. This function typically has to show a dialog where the user change the item. If not implemented, nothing happens.onMove(item, callback)
Fired when an item has been moved. If not implemented, the move action will be accepted.onMoving(item, callback)
Fired repeatedly while an item is being moved (dragged). Can be used to adjust the items start, end, and/or group to allowed regions.onRemove(item, callback)
Fired when an item is about to be deleted. If not implemented, the item will be always removed.
+ This example shows how to use callback functions onAdd
, onMove
, onMoving
, onUpdate
, and onRemove
. The onMoving
function updates an item while dragging, and can be used to prevent the item from being drawn at disallowed or infeasible timeslots. In this example, the items cannot be moved outside of the month April 2013. The other callback functions are called after an add, move, update, or remove action has taken place, and can be used to cancel these actions.
+