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.classList.add('btn');
|
||||||
this.resetLocationBtn.innerHTML = 'Reset Location';
|
this.resetLocationBtn.innerHTML = 'Reset Location';
|
||||||
this.resetLocationBtn.addEventListener('click', () => {
|
this.resetLocationBtn.addEventListener('click', () => {
|
||||||
const node = store.getNode(this.currentNodeID) || store.createNode(this.currentNodeID),
|
if (confirm("Reset location of this node?")) {
|
||||||
localNodeCopy = Object.assign({}, node);
|
const node = store.getNode(this.currentNodeID) || store.createNode(this.currentNodeID),
|
||||||
|
localNodeCopy = Object.assign({}, node);
|
||||||
|
|
||||||
localNodeCopy.location = null;
|
localNodeCopy.location = null;
|
||||||
this.currentNodeIsRendered = false;
|
this.currentNodeIsRendered = false;
|
||||||
socket.sendnode(localNodeCopy);
|
socket.sendnode(localNodeCopy);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue