Skip to content

Commit 19d364b

Browse files
author
Sandro Tajè
committed
added window to timeline
1 parent a40f364 commit 19d364b

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

angular-vis.js

+12-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@ angular.module('angular-vis', [])
1919
scope: {
2020
data: '=',
2121
options: '=',
22-
events: '='
22+
events: '=',
23+
window: "="
2324
},
2425
link: function(scope, element, attr) {
2526
var timelineEvents = [
@@ -72,6 +73,16 @@ angular.module('angular-vis', [])
7273
timeline.setOptions(options);
7374
});
7475

76+
scope.$watch('window', function(window) {
77+
if (timeline && window) {
78+
if (window.options) {
79+
timeline.setWindow(window.start, window.end, window.options);
80+
} else {
81+
timeline.setWindow(window.start, window.end);
82+
}
83+
}
84+
}, true);
85+
7586

7687
}
7788
};

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "angular-vis",
3-
"version": "1.0.0",
3+
"version": "1.0.2",
44
"description": "Angular directive for vis.js",
55
"main": "angular-vis.js",
66
"scripts": {

0 commit comments

Comments
 (0)