Browse Source

Fixed #1249: option `hiddenDates` not accepting a single hidden date

webworkersNetwork
jos 9 years ago
parent
commit
d7124f9df3
6 changed files with 62 additions and 17 deletions
  1. +5
    -2
      HISTORY.md
  2. +27
    -7
      dist/vis.js
  3. +11
    -3
      lib/timeline/DateUtil.js
  4. +7
    -2
      lib/timeline/TimeStep.js
  5. +6
    -1
      lib/timeline/optionsGraph2d.js
  6. +6
    -2
      lib/timeline/optionsTimeline.js

+ 5
- 2
HISTORY.md View File

@ -1,6 +1,7 @@
# vis.js history # vis.js history
http://visjs.org http://visjs.org
## NOT YET RELEASED, version 4.9.0 ## NOT YET RELEASED, version 4.9.0
### Network ### 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 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 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. - 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) - 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 ### Timeline
- Fixed #1326: wrongly positioned dot of PointItems. - 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. - 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 arrows with some shapes when they are selected. #1292
- Fixed deletion of options by settings them to null. - Fixed deletion of options by settings them to null.
## 2015-09-07, version 4.8.1 ## 2015-09-07, version 4.8.1
### Network ### Network

+ 27
- 7
dist/vis.js View File

@ -14117,11 +14117,15 @@ return /******/ (function(modules) { // webpackBootstrap
* *
* @param {function} moment * @param {function} moment
* @param {Object} body * @param {Object} body
* @param {Array} hiddenDates
* @param {Array | Object} hiddenDates
*/ */
"use strict"; "use strict";
exports.convertHiddenOptions = function (moment, body, hiddenDates) { exports.convertHiddenOptions = function (moment, body, hiddenDates) {
if (hiddenDates && !Array.isArray(hiddenDates)) {
return exports.convertHiddenOptions(moment, body, [hiddenDates]);
}
body.hiddenDates = []; body.hiddenDates = [];
if (hiddenDates) { if (hiddenDates) {
if (Array.isArray(hiddenDates) == true) { if (Array.isArray(hiddenDates) == true) {
@ -14144,9 +14148,13 @@ return /******/ (function(modules) { // webpackBootstrap
* create new entrees for the repeating hidden dates * create new entrees for the repeating hidden dates
* @param {function} moment * @param {function} moment
* @param {Object} body * @param {Object} body
* @param {Array} hiddenDates
* @param {Array | Object} hiddenDates
*/ */
exports.updateHiddenDates = function (moment, body, 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) { if (hiddenDates && body.domProps.centerContainer.width !== undefined) {
exports.convertHiddenOptions(moment, body, hiddenDates); exports.convertHiddenOptions(moment, body, hiddenDates);
@ -17535,8 +17543,11 @@ return /******/ (function(modules) { // webpackBootstrap
this.switchedDay = false; this.switchedDay = false;
this.switchedMonth = false; this.switchedMonth = false;
this.switchedYear = 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 = []; this.hiddenDates = [];
} }
@ -23300,10 +23311,14 @@ return /******/ (function(modules) { // webpackBootstrap
}, },
groupOrderSwap: { 'function': 'function' }, groupOrderSwap: { 'function': 'function' },
height: { string: string, number: number }, 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 }, locale: { string: string },
locales: { locales: {
__any__: { any: any },
__type__: { object: object } __type__: { object: object }
}, },
margin: { margin: {
@ -26789,7 +26804,12 @@ return /******/ (function(modules) { // webpackBootstrap
}, },
moment: { 'function': 'function' }, moment: { 'function': 'function' },
height: { string: string, number: number }, 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 }, locale: { string: string },
locales: { locales: {
__any__: { any: any }, __any__: { any: any },

+ 11
- 3
lib/timeline/DateUtil.js View File

@ -4,9 +4,13 @@
* *
* @param {function} moment * @param {function} moment
* @param {Object} body * @param {Object} body
* @param {Array} hiddenDates
* @param {Array | Object} hiddenDates
*/ */
exports.convertHiddenOptions = function(moment, body, hiddenDates) { exports.convertHiddenOptions = function(moment, body, hiddenDates) {
if (hiddenDates && !Array.isArray(hiddenDates)) {
return exports.convertHiddenOptions(moment, body, [hiddenDates])
}
body.hiddenDates = []; body.hiddenDates = [];
if (hiddenDates) { if (hiddenDates) {
if (Array.isArray(hiddenDates) == true) { if (Array.isArray(hiddenDates) == true) {
@ -30,9 +34,13 @@ exports.convertHiddenOptions = function(moment, body, hiddenDates) {
* create new entrees for the repeating hidden dates * create new entrees for the repeating hidden dates
* @param {function} moment * @param {function} moment
* @param {Object} body * @param {Object} body
* @param {Array} hiddenDates
* @param {Array | Object} hiddenDates
*/ */
exports.updateHiddenDates = function (moment, body, 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) { if (hiddenDates && body.domProps.centerContainer.width !== undefined) {
exports.convertHiddenOptions(moment, body, hiddenDates); exports.convertHiddenOptions(moment, body, hiddenDates);
@ -135,7 +143,7 @@ exports.updateHiddenDates = function (moment, body, hiddenDates) {
case "weekly": case "weekly":
startDate.add(1, 'weeks'); startDate.add(1, 'weeks');
endDate.add(1, 'weeks'); endDate.add(1, 'weeks');
break
break;
case "monthly": case "monthly":
startDate.add(1, 'months'); startDate.add(1, 'months');
endDate.add(1, 'months'); endDate.add(1, 'months');

+ 7
- 2
lib/timeline/TimeStep.js View File

@ -47,8 +47,13 @@ function TimeStep(start, end, minimumStep, hiddenDates) {
this.switchedDay = false; this.switchedDay = false;
this.switchedMonth = false; this.switchedMonth = false;
this.switchedYear = 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 = []; this.hiddenDates = [];
} }

+ 6
- 1
lib/timeline/optionsGraph2d.js View File

@ -128,7 +128,12 @@ let allOptions = {
}, },
moment: {'function': 'function'}, moment: {'function': 'function'},
height: {string, number}, height: {string, number},
hiddenDates: {object, array},
hiddenDates: {
start: {date, number, string, moment},
end: {date, number, string, moment},
repeat: {string},
__type__: {object, array}
},
locale:{string}, locale:{string},
locales:{ locales:{
__any__: {any}, __any__: {any},

+ 6
- 2
lib/timeline/optionsTimeline.js View File

@ -73,10 +73,14 @@ let allOptions = {
}, },
groupOrderSwap: {'function': 'function'}, groupOrderSwap: {'function': 'function'},
height: {string, number}, height: {string, number},
hiddenDates: {object, array},
hiddenDates: {
start: {date, number, string, moment},
end: {date, number, string, moment},
repeat: {string},
__type__: {object, array}
},
locale:{string}, locale:{string},
locales:{ locales:{
__any__: {any},
__type__: {object} __type__: {object}
}, },
margin: { margin: {

Loading…
Cancel
Save