diff --git a/HISTORY.md b/HISTORY.md index eabc887d..936b46e9 100644 --- a/HISTORY.md +++ b/HISTORY.md @@ -1,6 +1,7 @@ # vis.js history http://visjs.org + ## NOT YET RELEASED, version 4.9.0 ### Network @@ -8,13 +9,14 @@ http://visjs.org - Fixed bug where an edge that was not connected would crash the layout algorithms. - Fixed bug where a box shape could not be drawn outside of the viewable area. - Fixed bug where dragging a node that is not a control node during edit edge mode would throw an error. -- Made autoscaling on container size change pick the lowest between delta height and delta width. +- Made auto scaling on container size change pick the lowest between delta height and delta width. - Added images with borders option (useBorderWithImage) -- Updated the manipulation css to fix offset if there is no seperator. +- Updated the manipulation css to fix offset if there is no separator. ### Timeline - Fixed #1326: wrongly positioned dot of PointItems. +- Fixed #1249: option `hiddenDates` not accepting a single hidden date. - Fixed a bug when pinching and using hidden dates. Thanks @lauzierj. @@ -29,6 +31,7 @@ http://visjs.org - Fixed arrows with some shapes when they are selected. #1292 - Fixed deletion of options by settings them to null. + ## 2015-09-07, version 4.8.1 ### Network diff --git a/dist/vis.js b/dist/vis.js index bafba571..c5767b28 100644 --- a/dist/vis.js +++ b/dist/vis.js @@ -14117,11 +14117,15 @@ return /******/ (function(modules) { // webpackBootstrap * * @param {function} moment * @param {Object} body - * @param {Array} hiddenDates + * @param {Array | Object} hiddenDates */ "use strict"; exports.convertHiddenOptions = function (moment, body, hiddenDates) { + if (hiddenDates && !Array.isArray(hiddenDates)) { + return exports.convertHiddenOptions(moment, body, [hiddenDates]); + } + body.hiddenDates = []; if (hiddenDates) { if (Array.isArray(hiddenDates) == true) { @@ -14144,9 +14148,13 @@ return /******/ (function(modules) { // webpackBootstrap * create new entrees for the repeating hidden dates * @param {function} moment * @param {Object} body - * @param {Array} hiddenDates + * @param {Array | Object} hiddenDates */ exports.updateHiddenDates = function (moment, body, hiddenDates) { + if (hiddenDates && !Array.isArray(hiddenDates)) { + return exports.updateHiddenDates(moment, body, [hiddenDates]); + } + if (hiddenDates && body.domProps.centerContainer.width !== undefined) { exports.convertHiddenOptions(moment, body, hiddenDates); @@ -17535,8 +17543,11 @@ return /******/ (function(modules) { // webpackBootstrap this.switchedDay = false; this.switchedMonth = false; this.switchedYear = false; - this.hiddenDates = hiddenDates; - if (hiddenDates === undefined) { + if (Array.isArray(hiddenDates)) { + this.hiddenDates = hiddenDates; + } else if (hiddenDates != undefined) { + this.hiddenDates = [hiddenDates]; + } else { this.hiddenDates = []; } @@ -23300,10 +23311,14 @@ return /******/ (function(modules) { // webpackBootstrap }, groupOrderSwap: { 'function': 'function' }, height: { string: string, number: number }, - hiddenDates: { object: object, array: array }, + hiddenDates: { + start: { date: date, number: number, string: string, moment: moment }, + end: { date: date, number: number, string: string, moment: moment }, + repeat: { string: string }, + __type__: { object: object, array: array } + }, locale: { string: string }, locales: { - __any__: { any: any }, __type__: { object: object } }, margin: { @@ -26789,7 +26804,12 @@ return /******/ (function(modules) { // webpackBootstrap }, moment: { 'function': 'function' }, height: { string: string, number: number }, - hiddenDates: { object: object, array: array }, + hiddenDates: { + start: { date: date, number: number, string: string, moment: moment }, + end: { date: date, number: number, string: string, moment: moment }, + repeat: { string: string }, + __type__: { object: object, array: array } + }, locale: { string: string }, locales: { __any__: { any: any }, diff --git a/lib/timeline/DateUtil.js b/lib/timeline/DateUtil.js index 0f93e3e8..1a8a9076 100644 --- a/lib/timeline/DateUtil.js +++ b/lib/timeline/DateUtil.js @@ -4,9 +4,13 @@ * * @param {function} moment * @param {Object} body - * @param {Array} hiddenDates + * @param {Array | Object} hiddenDates */ exports.convertHiddenOptions = function(moment, body, hiddenDates) { + if (hiddenDates && !Array.isArray(hiddenDates)) { + return exports.convertHiddenOptions(moment, body, [hiddenDates]) + } + body.hiddenDates = []; if (hiddenDates) { if (Array.isArray(hiddenDates) == true) { @@ -30,9 +34,13 @@ exports.convertHiddenOptions = function(moment, body, hiddenDates) { * create new entrees for the repeating hidden dates * @param {function} moment * @param {Object} body - * @param {Array} hiddenDates + * @param {Array | Object} hiddenDates */ exports.updateHiddenDates = function (moment, body, hiddenDates) { + if (hiddenDates && !Array.isArray(hiddenDates)) { + return exports.updateHiddenDates(moment, body, [hiddenDates]) + } + if (hiddenDates && body.domProps.centerContainer.width !== undefined) { exports.convertHiddenOptions(moment, body, hiddenDates); @@ -135,7 +143,7 @@ exports.updateHiddenDates = function (moment, body, hiddenDates) { case "weekly": startDate.add(1, 'weeks'); endDate.add(1, 'weeks'); - break + break; case "monthly": startDate.add(1, 'months'); endDate.add(1, 'months'); diff --git a/lib/timeline/TimeStep.js b/lib/timeline/TimeStep.js index c4412f3f..e7cb1888 100644 --- a/lib/timeline/TimeStep.js +++ b/lib/timeline/TimeStep.js @@ -47,8 +47,13 @@ function TimeStep(start, end, minimumStep, hiddenDates) { this.switchedDay = false; this.switchedMonth = false; this.switchedYear = false; - this.hiddenDates = hiddenDates; - if (hiddenDates === undefined) { + if (Array.isArray(hiddenDates)) { + this.hiddenDates = hiddenDates; + } + else if (hiddenDates != undefined) { + this.hiddenDates = [hiddenDates]; + } + else { this.hiddenDates = []; } diff --git a/lib/timeline/optionsGraph2d.js b/lib/timeline/optionsGraph2d.js index d5ef4bae..a2faf89d 100644 --- a/lib/timeline/optionsGraph2d.js +++ b/lib/timeline/optionsGraph2d.js @@ -128,7 +128,12 @@ let allOptions = { }, moment: {'function': 'function'}, height: {string, number}, - hiddenDates: {object, array}, + hiddenDates: { + start: {date, number, string, moment}, + end: {date, number, string, moment}, + repeat: {string}, + __type__: {object, array} + }, locale:{string}, locales:{ __any__: {any}, diff --git a/lib/timeline/optionsTimeline.js b/lib/timeline/optionsTimeline.js index 8f8c829a..5d0ad3c1 100644 --- a/lib/timeline/optionsTimeline.js +++ b/lib/timeline/optionsTimeline.js @@ -73,10 +73,14 @@ let allOptions = { }, groupOrderSwap: {'function': 'function'}, height: {string, number}, - hiddenDates: {object, array}, + hiddenDates: { + start: {date, number, string, moment}, + end: {date, number, string, moment}, + repeat: {string}, + __type__: {object, array} + }, locale:{string}, locales:{ - __any__: {any}, __type__: {object} }, margin: {