diff --git a/Thread.js b/Thread.js index f67c93e..3b646c3 100644 --- a/Thread.js +++ b/Thread.js @@ -37,10 +37,17 @@ class Thread { step() { console.log(`Stepping thread: ${this.id}`); var hasMore = this.interpreter.run(); - if (!hasMore) this.die(); + // if (!hasMore) this.die(); + if (!hasMore) { + this.die(); + } } die() { + let thread = this; + Thread.FinishedAll({ + targetID: thread.target.id, + }); this.target.removeThread(this.id); } @@ -107,5 +114,14 @@ class Thread { 'data': data, })); + } + + static FinishedAll(data) { + console.log('Finished All!', data); + window.socket.send(JSON.stringify({ + 'type': 'FinishedAll', + 'data': data, + })); + } } \ No newline at end of file diff --git a/custom-dialog.js b/custom-dialog.js index 168e167..1a2e7fe 100644 --- a/custom-dialog.js +++ b/custom-dialog.js @@ -117,12 +117,14 @@ .appendChild(document.createTextNode(message)); var onOkay = function(event) { - CustomDialog.hide(); + dialogDiv.style.display = 'none'; + backdropDiv.style.display = 'none'; options.onOkay && options.onOkay(); event && event.stopPropagation(); }; var onCancel = function(event) { - CustomDialog.hide(); + dialogDiv.style.display = 'none'; + backdropDiv.style.display = 'none'; options.onCancel && options.onCancel(); event && event.stopPropagation(); };