Browse Source

Fixed #1584: Navigation buttons broken

codeClimate
jos 8 years ago
parent
commit
9136141cf7
2 changed files with 4 additions and 22 deletions
  1. +2
    -1
      HISTORY.md
  2. +2
    -21
      lib/hammerUtil.js

+ 2
- 1
HISTORY.md View File

@ -6,12 +6,13 @@ http://visjs.org
### Network ### Network
- Added options to customize the hierarchical layout without the use of physics.
- Altered edges for arrows and added the arrowStrikethrough option. - Altered edges for arrows and added the arrowStrikethrough option.
- Improved the hierarchical layout algorithm by adding a condensing method to remove whitespace. - Improved the hierarchical layout algorithm by adding a condensing method to remove whitespace.
- Fixed #1556: Network throwing an error when clicking the "Edit" button - Fixed #1556: Network throwing an error when clicking the "Edit" button
on the manipulation toolbar. on the manipulation toolbar.
- Fixed #1334 (again): Network now ignores scroll when interaction:zoomView is false. - 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 ### Graph2d

+ 2
- 21
lib/hammerUtil.js View File

@ -7,23 +7,14 @@ var Hammer = require('./module/hammer');
*/ */
exports.onTouch = function (hammer, callback) { exports.onTouch = function (hammer, callback) {
callback.inputHandler = function (event) { callback.inputHandler = function (event) {
if (event.isFirst && !isTouching) {
if (event.isFirst) {
callback(event); callback(event);
isTouching = true;
setTimeout(function () {
isTouching = false;
}, 0);
} }
}; };
hammer.on('hammer.input', callback.inputHandler); 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 * Register a release event, taking place after a gesture
* @param {Hammer} hammer A hammer instance * @param {Hammer} hammer A hammer instance
@ -31,13 +22,8 @@ var isTouching = false;
*/ */
exports.onRelease = function (hammer, callback) { exports.onRelease = function (hammer, callback) {
callback.inputHandler = function (event) { callback.inputHandler = function (event) {
if (event.isFinal && !isReleasing) {
if (event.isFinal) {
callback(event); 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 * Unregister a touch event, taking place before a gesture
* @param {Hammer} hammer A hammer instance * @param {Hammer} hammer A hammer instance

Loading…
Cancel
Save