Browse Source

fully working hiddenDates! woohoo!

v3_develop
Alex de Mulder 10 years ago
parent
commit
3c8df26e41
4 changed files with 26038 additions and 25802 deletions
  1. +26023
    -25793
      dist/vis.js
  2. +5
    -5
      examples/timeline/hiding_times.html
  3. +10
    -3
      lib/timeline/DateUtil.js
  4. +0
    -1
      lib/timeline/Range.js

+ 26023
- 25793
dist/vis.js
File diff suppressed because it is too large
View File


+ 5
- 5
examples/timeline/hiding_times.html View File

@ -1,7 +1,7 @@
<!DOCTYPE HTML>
<html>
<head>
<title>Timeline | Basic demo</title>
<title>Timeline | Hiding times demo</title>
<style type="text/css">
body, html {
@ -32,10 +32,10 @@
// Configuration for the Timeline
var options = {
hiddenDates: {
// specific:[
// {start: '2014-04-21 00:00:00', end: '2014-04-22 00:00:00'},
// {start: '2014-04-05 00:00:00', end: '2014-04-10 00:00:00'}
// ],
specific:[
{start: '2014-03-21 00:00:00', end: '2014-03-28 00:00:00'},
{start: '2014-03-05 00:00:00', end: '2014-03-10 00:00:00'}
],
periodic: {
times: [{start:'20:00:00', end:'09:00:00'}],
days: [{start: 6, end:1}] // 1 - 7 : Monday - Sunday

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

@ -111,8 +111,15 @@ exports.updateHiddenDates = function (body, hiddenDates) {
}
}
exports.removeDuplicates(body);
//var startHidden = exports.isHidden(body.range.start, body.hiddenDates);
//var endHidden = exports.isHidden(body.range.end,body.hiddenDates);
var startHidden = exports.isHidden(body.range.start, body.hiddenDates);
var endHidden = exports.isHidden(body.range.end,body.hiddenDates);
var rangeStart = body.range.start;
var rangeEnd = body.range.end;
if (startHidden.hidden == true) {rangeStart = startHidden.endDate;}
if (endHidden.hidden == true) {rangeEnd = endHidden.startDate;}
if (startHidden.hidden == true || endHidden.hidden == true) {
body.range._applyRange(rangeStart, rangeEnd);
}
}
}
@ -297,7 +304,7 @@ exports.correctTimeForDuration = function(hiddenTimes, range, time) {
/**
* Used with zooming and dragging
* Used with zooming and dragging, zoom inverts the left right for the start
*
* @param hiddenTimes
* @param range

+ 0
- 1
lib/timeline/Range.js View File

@ -610,7 +610,6 @@ Range.prototype.zoom = function(scale, center, delta) {
var safeDates = DateUtil.snapAwayFromHidden(this.body.hiddenDates, this, newStart, newEnd, delta, true);
//console.log(new Date(this.start), new Date(this.end), new Date(newStart), new Date(newEnd),new Date(safeDates.newStart), new Date(safeDates.newEnd));
if (safeDates !== false) {
newStart = safeDates.newStart;
newEnd = safeDates.newEnd;
}

Loading…
Cancel
Save