From 534ad9f32fa68c63bb58f522152549f8490f73dc Mon Sep 17 00:00:00 2001 From: yotamberk Date: Tue, 27 Dec 2016 11:52:43 +0200 Subject: [PATCH] fix #2500 for timeline (#2506) * Fix redraw order * Fix error when option is not defined * Allow template labels * Fix boolean types bug --- lib/timeline/optionsTimeline.js | 60 ++++++++++++++++----------------- 1 file changed, 30 insertions(+), 30 deletions(-) diff --git a/lib/timeline/optionsTimeline.js b/lib/timeline/optionsTimeline.js index 9bacbdd47..948022fd0 100644 --- a/lib/timeline/optionsTimeline.js +++ b/lib/timeline/optionsTimeline.js @@ -17,28 +17,28 @@ let any = 'any'; let allOptions = { configure: { - enabled: {bool}, - filter: {bool,'function': 'function'}, + enabled: { 'boolean': bool}, + filter: { 'boolean': bool,'function': 'function'}, container: {dom}, - __type__: {object,bool,'function': 'function'} + __type__: {object, 'boolean': bool,'function': 'function'} }, //globals : align: {string}, - rtl: {bool, 'undefined': 'undefined'}, - rollingMode: {bool, 'undefined': 'undefined'}, - verticalScroll: {bool, 'undefined': 'undefined'}, - horizontalScroll: {bool, 'undefined': 'undefined'}, - autoResize: {bool}, - clickToUse: {bool}, + rtl: { 'boolean': bool, 'undefined': 'undefined'}, + rollingMode: { 'boolean': bool, 'undefined': 'undefined'}, + verticalScroll: { 'boolean': bool, 'undefined': 'undefined'}, + horizontalScroll: { 'boolean': bool, 'undefined': 'undefined'}, + autoResize: { 'boolean': bool}, + clickToUse: { 'boolean': bool}, dataAttributes: {string, array}, editable: { - add: {bool, 'undefined': 'undefined'}, - remove: {bool, 'undefined': 'undefined'}, - updateGroup: {bool, 'undefined': 'undefined'}, - updateTime: {bool, 'undefined': 'undefined'}, - overrideItems: {bool, 'undefined': 'undefined'}, - __type__: {bool, object} + add: { 'boolean': bool, 'undefined': 'undefined'}, + remove: { 'boolean': bool, 'undefined': 'undefined'}, + updateGroup: { 'boolean': bool, 'undefined': 'undefined'}, + updateTime: { 'boolean': bool, 'undefined': 'undefined'}, + overrideItems: { 'boolean': bool, 'undefined': 'undefined'}, + __type__: { 'boolean': bool, object} }, end: {number, date, string, moment}, format: { @@ -69,10 +69,10 @@ let allOptions = { moment: {'function': 'function'}, groupOrder: {string, 'function': 'function'}, groupEditable: { - add: {bool, 'undefined': 'undefined'}, - remove: {bool, 'undefined': 'undefined'}, - order: {bool, 'undefined': 'undefined'}, - __type__: {bool, object} + add: { 'boolean': bool, 'undefined': 'undefined'}, + remove: { 'boolean': bool, 'undefined': 'undefined'}, + order: { 'boolean': bool, 'undefined': 'undefined'}, + __type__: { 'boolean': bool, object} }, groupOrderSwap: {'function': 'function'}, height: {string, number}, @@ -82,7 +82,7 @@ let allOptions = { repeat: {string}, __type__: {object, array} }, - itemsAlwaysDraggable: {bool}, + itemsAlwaysDraggable: { 'boolean': bool}, locale:{string}, locales:{ __any__: {any}, @@ -102,9 +102,9 @@ let allOptions = { maxMinorChars: {number}, min: {date, number, string, moment}, minHeight: {number, string}, - moveable: {bool}, - multiselect: {bool}, - multiselectPerGroup: {bool}, + moveable: { 'boolean': bool}, + multiselect: { 'boolean': bool}, + multiselectPerGroup: { 'boolean': bool}, onAdd: {'function': 'function'}, onUpdate: {'function': 'function'}, onMove: {'function': 'function'}, @@ -119,11 +119,11 @@ let allOptions = { item: {string,'undefined': 'undefined'}, __type__: {string, object} }, - selectable: {bool}, - showCurrentTime: {bool}, - showMajorLabels: {bool}, - showMinorLabels: {bool}, - stack: {bool}, + selectable: { 'boolean': bool}, + showCurrentTime: { 'boolean': bool}, + showMajorLabels: { 'boolean': bool}, + showMinorLabels: { 'boolean': bool}, + stack: { 'boolean': bool}, snap: {'function': 'function', 'null': 'null'}, start: {date, number, string, moment}, template: {'function': 'function'}, @@ -131,7 +131,7 @@ let allOptions = { visibleFrameTemplate: {string, 'function': 'function'}, tooltipOnItemUpdateTime: { template: {'function': 'function'}, - __type__: {bool, object} + __type__: { 'boolean': bool, object} }, timeAxis: { scale: {string,'undefined': 'undefined'}, @@ -140,7 +140,7 @@ let allOptions = { }, type: {string}, width: {string, number}, - zoomable: {bool}, + zoomable: { 'boolean': bool}, zoomKey: {string: ['ctrlKey', 'altKey', 'metaKey', '']}, zoomMax: {number}, zoomMin: {number},