Implemented 2D visualization for notes using Vue Flow
This commit is contained in:
28
node_modules/d3-drag/src/nodrag.js
generated
vendored
Normal file
28
node_modules/d3-drag/src/nodrag.js
generated
vendored
Normal file
@@ -0,0 +1,28 @@
|
||||
import {select} from "d3-selection";
|
||||
import noevent, {nonpassivecapture} from "./noevent.js";
|
||||
|
||||
export default function(view) {
|
||||
var root = view.document.documentElement,
|
||||
selection = select(view).on("dragstart.drag", noevent, nonpassivecapture);
|
||||
if ("onselectstart" in root) {
|
||||
selection.on("selectstart.drag", noevent, nonpassivecapture);
|
||||
} else {
|
||||
root.__noselect = root.style.MozUserSelect;
|
||||
root.style.MozUserSelect = "none";
|
||||
}
|
||||
}
|
||||
|
||||
export function yesdrag(view, noclick) {
|
||||
var root = view.document.documentElement,
|
||||
selection = select(view).on("dragstart.drag", null);
|
||||
if (noclick) {
|
||||
selection.on("click.drag", noevent, nonpassivecapture);
|
||||
setTimeout(function() { selection.on("click.drag", null); }, 0);
|
||||
}
|
||||
if ("onselectstart" in root) {
|
||||
selection.on("selectstart.drag", null);
|
||||
} else {
|
||||
root.style.MozUserSelect = root.__noselect;
|
||||
delete root.__noselect;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user