浏览代码

added right-click-open to hide references

Nicolas Cannasse 5 年之前
父节点
当前提交
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();
 		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) {
 		var props = ctx.properties.add(element, this, function(pname) {
 			ctx.onChange(this, pname);
 			ctx.onChange(this, pname);
 			if(pname == "refpath") {
 			if(pname == "refpath") {