Skip to content
Permalink
Browse files

use shift-click instead of double-click

  • Loading branch information...
InventivetalentDev committed Feb 22, 2019
1 parent 6c74999 commit 7d81c0e5d4474f57815dba78a52f98a573fa81c5
Showing with 22 additions and 17 deletions.
  1. +21 −16 js/nodeGenerator.js
  2. +1 −1 js/util.js
@@ -355,26 +355,31 @@ function init(extraLibraries) {
};
LGraphNode.prototype.onDblClick = function () {
console.log(this);
};
LGraphNode.prototype.onMouseDown = function (e) {
console.log(e);

let className = this.className;
if (!className) {
return;
}
let url;
if (className.startsWith("org.bukkit.")) {
url = "https://hub.spigotmc.org/javadocs/spigot/";
} else if (className.startsWith("java.")) {
url = "https://docs.oracle.com/javase/8/docs/api/";
}
if (!url) {
return;
}
if(e.shiftKey) {
let className = this.className;
if (!className) {
return;
}
let url;
if (className.startsWith("org.bukkit.")) {
url = "https://hub.spigotmc.org/javadocs/spigot/";
} else if (className.startsWith("java.")) {
url = "https://docs.oracle.com/javase/8/docs/api/";
}
if (!url) {
return;
}

url += className.split(".").join("/") + ".html";
url += className.split(".").join("/") + ".html";

/// TODO: link to individual fields/methods/etc.
/// TODO: link to individual fields/methods/etc.

shell.openExternal(url);
shell.openExternal(url);
}
};

LGraphNode.prototype.onDrawBackground = handleDescDrawBackground;
@@ -184,7 +184,7 @@ function handleDescDrawBackground(ctx) {

if (this.mouseOver) {
ctx.fillStyle = "#AAA";
this.descBlockHeight = wrapCanvasText(ctx, (this.desc || this.description) + " [double-click for more]", 0, this.size[1] + 14, this.size[0], 14);
this.descBlockHeight = wrapCanvasText(ctx, (this.desc || this.description) + " [shift-click for more]", 0, this.size[1] + 14, this.size[0], 14);
}
}

0 comments on commit 7d81c0e

Please sign in to comment.
You can’t perform that action at this time.