From 9136141cf700599f019a0f894058a76ac52492f0 Mon Sep 17 00:00:00 2001 From: jos Date: Wed, 20 Jan 2016 15:28:42 +0100 Subject: [PATCH] Fixed #1584: Navigation buttons broken --- HISTORY.md | 3 ++- lib/hammerUtil.js | 23 ++--------------------- 2 files changed, 4 insertions(+), 22 deletions(-) diff --git a/HISTORY.md b/HISTORY.md index d13c55f3..61558462 100644 --- a/HISTORY.md +++ b/HISTORY.md @@ -6,12 +6,13 @@ http://visjs.org ### Network +- Added options to customize the hierarchical layout without the use of physics. - Altered edges for arrows and added the arrowStrikethrough option. - Improved the hierarchical layout algorithm by adding a condensing method to remove whitespace. - Fixed #1556: Network throwing an error when clicking the "Edit" button on the manipulation toolbar. - Fixed #1334 (again): Network now ignores scroll when interaction:zoomView is false. -- Added options to customize the hierarchical layout without the use of physics. +- Fixed #1584: Navigation buttons broken. ### Graph2d diff --git a/lib/hammerUtil.js b/lib/hammerUtil.js index 9a2f1615..4e1b79d2 100644 --- a/lib/hammerUtil.js +++ b/lib/hammerUtil.js @@ -7,23 +7,14 @@ var Hammer = require('./module/hammer'); */ exports.onTouch = function (hammer, callback) { callback.inputHandler = function (event) { - if (event.isFirst && !isTouching) { + if (event.isFirst) { callback(event); - - isTouching = true; - setTimeout(function () { - isTouching = false; - }, 0); } }; hammer.on('hammer.input', callback.inputHandler); }; -// isTouching is true while a touch action is being emitted -// this is a hack to prevent `touch` from being fired twice -var isTouching = false; - /** * Register a release event, taking place after a gesture * @param {Hammer} hammer A hammer instance @@ -31,13 +22,8 @@ var isTouching = false; */ exports.onRelease = function (hammer, callback) { callback.inputHandler = function (event) { - if (event.isFinal && !isReleasing) { + if (event.isFinal) { callback(event); - - isReleasing = true; - setTimeout(function () { - isReleasing = false; - }, 0); } }; @@ -45,11 +31,6 @@ exports.onRelease = function (hammer, callback) { }; -// isReleasing is true while a release action is being emitted -// this is a hack to prevent `release` from being fired twice -var isReleasing = false; - - /** * Unregister a touch event, taking place before a gesture * @param {Hammer} hammer A hammer instance