From ad996647426d907c5a9a02a918630c2b5e5d3713 Mon Sep 17 00:00:00 2001 From: Alex de Mulder Date: Wed, 13 Aug 2014 11:06:45 +0200 Subject: [PATCH] fixed #235 --- dist/vis.js | 10 +++++----- lib/network/Edge.js | 2 +- lib/network/Network.js | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/dist/vis.js b/dist/vis.js index c58ad432..57cb30bf 100644 --- a/dist/vis.js +++ b/dist/vis.js @@ -5,7 +5,7 @@ * A dynamic, browser-based visualization library. * * @version 3.1.1-SNAPSHOT - * @date 2014-07-24 + * @date 2014-08-13 * * @license * Copyright (C) 2011-2014 Almende B.V, http://almende.com @@ -15353,11 +15353,11 @@ return /******/ (function(modules) { // webpackBootstrap if (content instanceof Element) { this.dom.inner.appendChild(content); } - else if (content != undefined) { + else if (content !== undefined && content !== null) { this.dom.inner.innerHTML = content; } else { - this.dom.inner.innerHTML = this.groupId; + this.dom.inner.innerHTML = this.groupId || ''; // groupId can be null } // update title @@ -19731,7 +19731,7 @@ return /******/ (function(modules) { // webpackBootstrap } } } - console.log(this.triggerFunctions) + if (options.onAdd) {this.triggerFunctions.add = options.onAdd;} if (options.onEdit) {this.triggerFunctions.edit = options.onEdit;} if (options.onEditEdge) {this.triggerFunctions.editEdge = options.onEditEdge;} @@ -25213,7 +25213,7 @@ return /******/ (function(modules) { // webpackBootstrap }; Edge.prototype.positionBezierNode = function() { - if (this.via !== null) { + if (this.via !== null && this.from !== null && this.to !== null) { this.via.x = 0.5 * (this.from.x + this.to.x); this.via.y = 0.5 * (this.from.y + this.to.y); } diff --git a/lib/network/Edge.js b/lib/network/Edge.js index 61b456ef..f5231249 100644 --- a/lib/network/Edge.js +++ b/lib/network/Edge.js @@ -1006,7 +1006,7 @@ Edge.prototype.unselect = function() { }; Edge.prototype.positionBezierNode = function() { - if (this.via !== null) { + if (this.via !== null && this.from !== null && this.to !== null) { this.via.x = 0.5 * (this.from.x + this.to.x); this.via.y = 0.5 * (this.from.y + this.to.y); } diff --git a/lib/network/Network.js b/lib/network/Network.js index 21cdba38..743e9b16 100644 --- a/lib/network/Network.js +++ b/lib/network/Network.js @@ -588,7 +588,7 @@ Network.prototype.setOptions = function (options) { } } } - console.log(this.triggerFunctions) + if (options.onAdd) {this.triggerFunctions.add = options.onAdd;} if (options.onEdit) {this.triggerFunctions.edit = options.onEdit;} if (options.onEditEdge) {this.triggerFunctions.editEdge = options.onEditEdge;}