|
|
@ -16,15 +16,9 @@ var ItemSet = require('./component/ItemSet'); |
|
|
|
* @param {vis.DataSet | Array | google.visualization.DataTable} [items] |
|
|
|
* @param {Object} [options] See Timeline.setOptions for the available options. |
|
|
|
* @constructor |
|
|
|
* @extends Core |
|
|
|
*/ |
|
|
|
function Timeline (container, items, options) { |
|
|
|
// mix the core properties in here
|
|
|
|
for (var coreProp in Core.prototype) { |
|
|
|
if (Core.prototype.hasOwnProperty(coreProp) && !Timeline.prototype.hasOwnProperty(coreProp)) { |
|
|
|
Timeline.prototype[coreProp] = Core.prototype[coreProp]; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
if (!(this instanceof Timeline)) { |
|
|
|
throw new SyntaxError('Constructor must be called with the new operator'); |
|
|
|
} |
|
|
@ -107,6 +101,9 @@ function Timeline (container, items, options) { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
// Extend the functionality from Core
|
|
|
|
Timeline.prototype = new Core(); |
|
|
|
|
|
|
|
/** |
|
|
|
* Set options. Options will be passed to all components loaded in the Timeline. |
|
|
|
* @param {Object} [options] |
|
|
@ -135,7 +132,7 @@ function Timeline (container, items, options) { |
|
|
|
Timeline.prototype.setOptions = function (options) { |
|
|
|
if (options) { |
|
|
|
// copy the known options
|
|
|
|
var fields = ['width', 'height', 'minHeight', 'maxHeight', 'autoResize', 'start', 'end', 'orientation']; |
|
|
|
var fields = ['width', 'height', 'minHeight', 'maxHeight', 'autoResize', 'start', 'end', 'orientation', 'activatable']; |
|
|
|
util.selectiveExtend(fields, this.options, options); |
|
|
|
|
|
|
|
// enable/disable autoResize
|
|
|
|