node page: ask for confirmation before resetting node location
This commit is contained in:
parent
bd7b9c10aa
commit
668ba59b8d
|
@ -149,12 +149,14 @@ export class NodeView extends View {
|
|||
this.resetLocationBtn.classList.add('btn');
|
||||
this.resetLocationBtn.innerHTML = 'Reset Location';
|
||||
this.resetLocationBtn.addEventListener('click', () => {
|
||||
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);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue