瀏覽代碼

Test in JS for nodes which already exists.

master
Pete Shadbolt 8 年之前
父節點
當前提交
f1a7498f9c
共有 1 個文件被更改,包括 4 次插入0 次删除
  1. +4
    -0
      abp/static/scripts/editor.js

+ 4
- 0
abp/static/scripts/editor.js 查看文件

@@ -44,6 +44,10 @@ editor.addQubitAtPoint = function(point) {
}
point.round();
var new_node = Math.floor(point.x) + "," + Math.floor(point.y) + "," + Math.floor(point.z);
if (Object.prototype.hasOwnProperty.call(abj.node, new_node)) {
gui.serverMessage("Node " + new_node +" already exists.");
return;
}
websocket.edit({action:"create", name:new_node, position: point});
editor.focus(new_node);
gui.serverMessage("Created node " + new_node +".");


Loading…
取消
儲存