2
0
Эх сурвалжийг харах

added right-click-open to hide references

Nicolas Cannasse 5 жил өмнө
parent
commit
7891bc7ee5
1 өөрчлөгдсөн 10 нэмэгдсэн , 0 устгасан
  1. 10 0
      hrt/prefab/Reference.hx

+ 10 - 0
hrt/prefab/Reference.hx

@@ -144,6 +144,16 @@ class Reference extends Object3D {
 		}
 		updateProps();
 
+		element.find("input").contextmenu((e) -> {
+			e.preventDefault();
+			if( isFile() ) {
+				new hide.comp.ContextMenu([{
+					label : "Open",
+					click : () -> ctx.ide.openFile(ctx.ide.getPath(refpath.substr(1))),
+				}]);
+			}
+		});
+
 		var props = ctx.properties.add(element, this, function(pname) {
 			ctx.onChange(this, pname);
 			if(pname == "refpath") {