diff --git a/webroot/js/view/node.js b/webroot/js/view/node.js index eb0f0ee..7d47cf6 100644 --- a/webroot/js/view/node.js +++ b/webroot/js/view/node.js @@ -149,12 +149,14 @@ export class NodeView extends View { this.resetLocationBtn.classList.add('btn'); this.resetLocationBtn.innerHTML = 'Reset Location'; this.resetLocationBtn.addEventListener('click', () => { - const node = store.getNode(this.currentNodeID) || store.createNode(this.currentNodeID), - localNodeCopy = Object.assign({}, node); + if (confirm("Reset location of this node?")) { + const node = store.getNode(this.currentNodeID) || store.createNode(this.currentNodeID), + localNodeCopy = Object.assign({}, node); - localNodeCopy.location = null; - this.currentNodeIsRendered = false; - socket.sendnode(localNodeCopy); + localNodeCopy.location = null; + this.currentNodeIsRendered = false; + socket.sendnode(localNodeCopy); + } }); }