Browse Source

Remove all `Object.assign` from examples (for browsers that don;t support es5+) (#2829)

* Fix redraw order

* Fix error when option is not defined

* Allow template labels

* Add .travis.yml file

* Add experiment travis code

* Fix react example

* Remove assign from examples

* Use jQuery
dependencies
yotamberk 7 years ago
committed by GitHub
parent
commit
6586c53dd1
3 changed files with 13 additions and 10 deletions
  1. +7
    -6
      examples/timeline/editing/tooltipOnItemChange.html
  2. +3
    -2
      examples/timeline/other/rtl.html
  3. +3
    -2
      examples/timeline/other/verticalScroll.html

+ 7
- 6
examples/timeline/editing/tooltipOnItemChange.html View File

@ -2,6 +2,7 @@
<head>
<title>Timeline | Tooltip on item onUpdateTime Option</title>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.1/jquery.min.js"></script>
<script src="../../../dist/vis.js"></script>
<link href="../../../dist/vis.css" rel="stylesheet" type="text/css" />
@ -63,20 +64,20 @@
editable: true
};
var options1 = Object.assign({
var options1 = jQuery.extend(options, {
tooltipOnItemUpdateTime: true
}, options)
})
var container1 = document.getElementById('mytimeline1');
timeline1 = new vis.Timeline(container1, items, null, options1);
var options2 = Object.assign({
var options2 = jQuery.extend(options, {
orientation: 'top',
tooltipOnItemUpdateTime: {
template: function(item) {
return 'html template for tooltip with <b>item.start</b>: ' + item.start;
}
}
}, options)
})
var container2 = document.getElementById('mytimeline2');
timeline2 = new vis.Timeline(container2, items, null, options2);
@ -117,10 +118,10 @@
}
var options3 = Object.assign({
var options3 = jQuery.extend(options, {
orientation: 'top',
tooltipOnItemUpdateTime: true
}, options)
})
var container3 = document.getElementById('mytimeline3');
timeline3 = new vis.Timeline(container3, itemsWithGroups, groups, options3);

+ 3
- 2
examples/timeline/other/rtl.html View File

@ -3,6 +3,7 @@
<head>
<title>Timeline | RTL example</title>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.1/jquery.min.js"></script>
<script src="../../../dist/vis.js"></script>
<link href="../../../dist/vis-timeline-graph2d.min.css" rel="stylesheet" type="text/css" />
@ -39,10 +40,10 @@
height: '300px',
};
var options1 = Object.assign({}, options)
var options1 = jQuery.extend(options, {})
var timeline1 = new vis.Timeline(container1, items, options1);
var options2 = Object.assign({rtl: true}, options)
var options2 = jQuery.extend(options, {rtl: true})
var timeline2 = new vis.Timeline(container2, items, options2);
</script>

+ 3
- 2
examples/timeline/other/verticalScroll.html View File

@ -2,6 +2,7 @@
<head>
<title>Timeline | Vertical Scroll Option</title>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.1/jquery.min.js"></script>
<script src="../../../dist/vis.js"></script>
<link href="../../../dist/vis.css" rel="stylesheet" type="text/css" />
@ -75,11 +76,11 @@ zoomKey: 'ctrlKey'
// create a Timeline
options1 = Object.assign({}, options)
options1 = jQuery.extend(options, {});
var container1 = document.getElementById('mytimeline1');
timeline1 = new vis.Timeline(container1, items, groups, options1);
options2 = Object.assign({horizontalScroll: true}, options)
options2 = jQuery.extend(options, {horizontalScroll: true});
var container2 = document.getElementById('mytimeline2');
timeline2 = new vis.Timeline(container2, items, groups, options2);

Loading…
Cancel
Save