From bdf11324d10dbc3e59d3a2d27aaecce11347d53a Mon Sep 17 00:00:00 2001 From: Alex de Mulder Date: Thu, 30 Apr 2015 16:46:49 +0200 Subject: [PATCH] fixed buttons --- dist/vis.js | 17 ++++++++--------- lib/network/modules/CanvasRenderer.js | 5 +++-- .../modules/components/NavigationHandler.js | 6 +++--- 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/dist/vis.js b/dist/vis.js index 59a77994..eb067941 100644 --- a/dist/vis.js +++ b/dist/vis.js @@ -21534,7 +21534,7 @@ return /******/ (function(modules) { // webpackBootstrap this.canvas = canvas; this.redrawRequested = false; - this.renderTimer = false; + this.renderTimer = undefined; this.requiresTimeout = true; this.renderingActive = false; this.renderRequests = 0; @@ -21584,6 +21584,7 @@ return /******/ (function(modules) { // webpackBootstrap this.body.emitter.on('_stopRendering', function () { _this.renderRequests -= 1; _this.renderingActive = _this.renderRequests > 0; + _this.renderTimer = undefined; }); this.body.emitter.on('destroy', function () { _this.renderRequests = 0; @@ -21607,7 +21608,7 @@ return /******/ (function(modules) { // webpackBootstrap key: '_startRendering', value: function _startRendering() { if (this.renderingActive === true) { - if (!this.renderTimer) { + if (this.renderTimer === undefined) { if (this.requiresTimeout === true) { this.renderTimer = window.setTimeout(this._renderStep.bind(this), this.simulationInterval); // wait this.renderTimeStep milliseconds and perform the animation step function } else { @@ -22904,7 +22905,6 @@ return /******/ (function(modules) { // webpackBootstrap yFixed: object.options.fixed.y }; - object.options.fixed = {}; object.options.fixed.x = true; object.options.fixed.y = true; @@ -33719,9 +33719,6 @@ return /******/ (function(modules) { // webpackBootstrap parentOptions.fixed.y = newOptions.fixed.y; } } - } else if (allowDeletion === true) { - parentOptions.fixed = undefined; - delete parentOptions.fixed; } } }]); @@ -35630,7 +35627,9 @@ return /******/ (function(modules) { // webpackBootstrap this.touchTime = 0; this.activated = false; - this.body.emitter.on('release', this._stopMovement.bind(this)); + this.body.emitter.on('release', function () { + _this._stopMovement(); + }); this.body.emitter.on('activate', function () { _this.activated = true;_this.configureKeyboardBindings(); }); @@ -35820,9 +35819,9 @@ return /******/ (function(modules) { // webpackBootstrap if (this.options.keyboard.enabled === true) { if (this.options.keyboard.bindToWindow === true) { - this.keycharm = keycharm({ container: window, preventDefault: false }); + this.keycharm = keycharm({ container: window, preventDefault: true }); } else { - this.keycharm = keycharm({ container: this.canvas.frame, preventDefault: false }); + this.keycharm = keycharm({ container: this.canvas.frame, preventDefault: true }); } this.keycharm.reset(); diff --git a/lib/network/modules/CanvasRenderer.js b/lib/network/modules/CanvasRenderer.js index 8ba8ed4f..078ce037 100644 --- a/lib/network/modules/CanvasRenderer.js +++ b/lib/network/modules/CanvasRenderer.js @@ -12,7 +12,7 @@ class CanvasRenderer { this.canvas = canvas; this.redrawRequested = false; - this.renderTimer = false; + this.renderTimer = undefined; this.requiresTimeout = true; this.renderingActive = false; this.renderRequests = 0; @@ -52,6 +52,7 @@ class CanvasRenderer { this.body.emitter.on("_stopRendering", () => { this.renderRequests -= 1; this.renderingActive = this.renderRequests > 0; + this.renderTimer = undefined; }); this.body.emitter.on('destroy', () => { this.renderRequests = 0; @@ -75,7 +76,7 @@ class CanvasRenderer { _startRendering() { if (this.renderingActive === true) { - if (!this.renderTimer) { + if (this.renderTimer === undefined) { if (this.requiresTimeout === true) { this.renderTimer = window.setTimeout(this._renderStep.bind(this), this.simulationInterval); // wait this.renderTimeStep milliseconds and perform the animation step function } diff --git a/lib/network/modules/components/NavigationHandler.js b/lib/network/modules/components/NavigationHandler.js index dfb33bc2..880c9cdb 100644 --- a/lib/network/modules/components/NavigationHandler.js +++ b/lib/network/modules/components/NavigationHandler.js @@ -15,7 +15,7 @@ class NavigationHandler { this.activated = false; - this.body.emitter.on("release", this._stopMovement.bind(this)); + this.body.emitter.on("release", () => {this._stopMovement();}); this.body.emitter.on("activate", () => {this.activated = true; this.configureKeyboardBindings();}); this.body.emitter.on("deactivate", () => {this.activated = false; this.configureKeyboardBindings();}); this.body.emitter.on("destroy", () => {if (this.keycharm !== undefined) {this.keycharm.destroy();}}); @@ -162,10 +162,10 @@ class NavigationHandler { if (this.options.keyboard.enabled === true) { if (this.options.keyboard.bindToWindow === true) { - this.keycharm = keycharm({container: window, preventDefault: false}); + this.keycharm = keycharm({container: window, preventDefault: true}); } else { - this.keycharm = keycharm({container: this.canvas.frame, preventDefault: false}); + this.keycharm = keycharm({container: this.canvas.frame, preventDefault: true}); } this.keycharm.reset();