From a83ef017b14b8a2b7fcb96ed39708ac6f12e0df7 Mon Sep 17 00:00:00 2001
From: Simon Morris
Date: Tue, 8 Nov 2016 14:42:48 -0800
Subject: [PATCH] Timeline editable can override items (#2284)
* Timeline:
* Add overrideItems sub-property to timeline.editable
* Change behavior to override item.editable when overrideItems=true
* Added new example for timeline/editing to higlight differeing editable behaviors.
* Update timeline doc to reflect addition of timeline.editable.overrideItems
* Timeline - fixed logic oversights found in editable override testing
* Timeline - enable changeGroup when item.editable = true and not overriden
* Timeline - Small format changes to documentation and example pages for overrideItems
---
docs/timeline/index.html | 15 ++-
.../editing/overrideEditingItems.html | 99 +++++++++++++++++++
lib/timeline/component/ItemSet.js | 34 ++++---
lib/timeline/component/item/Item.js | 7 +-
lib/timeline/optionsTimeline.js | 1 +
5 files changed, 134 insertions(+), 22 deletions(-)
create mode 100644 examples/timeline/editing/overrideEditingItems.html
diff --git a/docs/timeline/index.html b/docs/timeline/index.html
index b7a14a1c..a547e993 100644
--- a/docs/timeline/index.html
+++ b/docs/timeline/index.html
@@ -339,7 +339,7 @@ var items = new vis.DataSet([
editable
Boolean
no
-
Override the editable option of the timeline for a specific item.
+
Override the editable option of the timeline for a specific item (assuming timeline.editable.overrideItems is false).
Groups
@@ -545,6 +545,12 @@ function (option, path) {
false
If true, items can be dragged to another moment in time. See section Editing Items for a detailed explanation.
+
+
editable.overrideItems
+
boolean
+
false
+
If true, item specific editable properties are overridden by timeline settings
+
end
@@ -1041,7 +1047,7 @@ function (option, path) {
verticalScroll
Boolean
false
-
Show a vertical scroll on the side of the group list and link it to the scroll event when zoom is not triggered. Notice that defining this option as true will NOT override horizontalScroll. The scroll event will be vertically ignored, but a vertical scrollbar will be visible
+
Show a vertical scroll on the side of the group list and link it to the scroll event when zoom is not triggered. Notice that defining this option as true will NOT override horizontalScroll. The scroll event will be vertically ignored, but a vertical scrollbar will be visible
@@ -1566,12 +1572,13 @@ var options = {
add: true, // add new items by double tapping
updateTime: true, // drag items horizontally
updateGroup: true, // drag items from one group to another
- remove: true // delete an item by tapping the delete button top right
+ remove: true, // delete an item by tapping the delete button top right
+ overrideItems: false // allow these options to override item.editable
}
};
- Editing can be enabled/disabled for specific items. Setting the property editable to true or false on a data item will override the timeline option.
+ Editing can be enabled/disabled for specific items. Setting the property editable to true or false on a data item will override the timeline option except when timeline.editable.overrideItems is set to true.