Browse Source

changed the dashes options, fixed event bugs in drag

flowchartTest
Alex de Mulder 9 years ago
parent
commit
f88863eecb
1 changed files with 25 additions and 3 deletions
  1. +25
    -3
      dist/vis.js

+ 25
- 3
dist/vis.js View File

@ -13664,7 +13664,7 @@ return /******/ (function(modules) { // webpackBootstrap
//} //}
// //
var clientY = event.gesture.center.clientY;
var clientY = event.center.clientY;
for (var i = 0; i < this.groupIds.length; i++) { for (var i = 0; i < this.groupIds.length; i++) {
var groupId = this.groupIds[i]; var groupId = this.groupIds[i];
var group = this.groups[groupId]; var group = this.groups[groupId];
@ -17125,6 +17125,11 @@ return /******/ (function(modules) { // webpackBootstrap
me.emit('touch', event); me.emit('touch', event);
}).bind(this)); }).bind(this));
// emulate a release event (emitted after a pan, pinch, tap, or press)
hammerUtil.onRelease(this.hammer, (function (event) {
me.emit('release', event);
}).bind(this));
function onMouseWheel(event) { function onMouseWheel(event) {
if (me.isActive()) { if (me.isActive()) {
me.emit('mousewheel', event); me.emit('mousewheel', event);
@ -17928,14 +17933,23 @@ return /******/ (function(modules) { // webpackBootstrap
*/ */
exports.onTouch = function (hammer, callback) { exports.onTouch = function (hammer, callback) {
callback.inputHandler = function (event) { callback.inputHandler = function (event) {
if (event.isFirst) {
if (event.isFirst && !isTouching) {
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
@ -17943,13 +17957,21 @@ return /******/ (function(modules) { // webpackBootstrap
*/ */
exports.onRelease = function (hammer, callback) { exports.onRelease = function (hammer, callback) {
callback.inputHandler = function (event) { callback.inputHandler = function (event) {
if (event.isFinal) {
if (event.isFinal && !isReleasing) {
callback(event); callback(event);
isReleasing = true;
setTimeout(function () {
isReleasing = false;
}, 0);
} }
}; };
return hammer.on('hammer.input', callback.inputHandler); return hammer.on('hammer.input', callback.inputHandler);
}; };
// 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

Loading…
Cancel
Save