Browse Source

- Fixed #927, dragStart event didnt contain node that was being dragged

flowchartTest
AlexDM0 9 years ago
parent
commit
0987a84e04
3 changed files with 11799 additions and 11790 deletions
  1. +1
    -1
      HISTORY.md
  2. +11791
    -11787
      dist/vis.js
  3. +7
    -2
      lib/network/modules/InteractionHandler.js

+ 1
- 1
HISTORY.md View File

@ -30,7 +30,7 @@ http://visjs.org
- Added releaseFunction to openCluster.
- Fixed bug where the network could flicker when the pixelRatio is not integer.
- Added enabled property to physics.
- Fixed #927, dragStart event didnt contain node that was being dragged
## 2015-05-28, version 4.1.0

+ 11791
- 11787
dist/vis.js
File diff suppressed because it is too large
View File


+ 7
- 2
lib/network/modules/InteractionHandler.js View File

@ -282,8 +282,6 @@ class InteractionHandler {
this.drag.translation = util.extend({},this.body.view.translation); // copy the object
this.drag.nodeId = undefined;
this.selectionHandler._generateClickEvent('dragStart', event, this.drag.pointer);
if (node !== undefined && this.options.dragNodes === true) {
this.drag.nodeId = node.id;
// select the clicked node if not yet selected
@ -292,6 +290,9 @@ class InteractionHandler {
this.selectionHandler.selectObject(node);
}
// after select to contain the node
this.selectionHandler._generateClickEvent('dragStart', event, this.drag.pointer);
let selection = this.selectionHandler.selectionObj.nodes;
// create an array with the selected nodes and their original location and status
for (let nodeId in selection) {
@ -315,6 +316,10 @@ class InteractionHandler {
}
}
}
else {
// fallback if no node is selected and thus the view is dragged.
this.selectionHandler._generateClickEvent('dragStart', event, this.drag.pointer);
}
}

Loading…
Cancel
Save