Browse Source

Throws an error when constructing without new keyword.

css_transitions
jos 10 years ago
parent
commit
3bb867890f
4 changed files with 27 additions and 1 deletions
  1. +16
    -1
      HISTORY.md
  2. +3
    -0
      src/graph/Graph.js
  3. +4
    -0
      src/graph3d/Graph3d.js
  4. +4
    -0
      src/timeline/Timeline.js

+ 16
- 1
HISTORY.md View File

@ -2,7 +2,22 @@
http://visjs.org
## not yet released, version 2.0.0
## 2014-06-19, version 2.0.1
### Timeline
- Throws an error when constructing without new keyword.
### Graph
- Throws an error when constructing without new keyword.
### Graph3d
- Throws an error when constructing without new keyword.
## 2014-06-19, version 2.0.0
### Timeline

+ 3
- 0
src/graph/Graph.js View File

@ -10,6 +10,9 @@
* @param {Object} options Options
*/
function Graph (container, data, options) {
if (!(this instanceof Graph)) {
throw new SyntaxError('Constructor must be called with the new operator');
}
this._initializeMixinLoaders();

+ 4
- 0
src/graph3d/Graph3d.js View File

@ -10,6 +10,10 @@
* @param {Object} [options]
*/
function Graph3d(container, data, options) {
if (!(this instanceof Graph3d)) {
throw new SyntaxError('Constructor must be called with the new operator');
}
// create variables and set default values
this.containerElement = container;
this.width = '400px';

+ 4
- 0
src/timeline/Timeline.js View File

@ -6,6 +6,10 @@
* @constructor
*/
function Timeline (container, items, options) {
if (!(this instanceof Timeline)) {
throw new SyntaxError('Constructor must be called with the new operator');
}
var me = this;
this.defaultOptions = {
start: null,

Loading…
Cancel
Save