Skip to content

Commit

Permalink
Added workaround for problem where devviz wasn't moving after a reloa…
Browse files Browse the repository at this point in the history
…d of the main window
  • Loading branch information
andreas-kraus committed Sep 12, 2020
1 parent 9aea05a commit 63eed1d
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions Userland/public/js/controller/MainController.js
Original file line number Diff line number Diff line change
Expand Up @@ -371,6 +371,13 @@ class MainController extends EventTarget{
_handleDevVisualization() {
this._openedWindow = window.open("dev_visualization.html","dev_visualization","channelmode, width=700, height=600, menubar=no, scrollbars=no, status=no, toolbar=no");
this._openedWindow.postMessage(this.mainModel.selectedEmotion, "*");

//Workaround for losing reference to devviz window on reload. This closes the devviz whenever the main window closes or reloads.
window.onunload = () => {
if(this._openedWindow && !this._openedWindow.closed){
this._openedWindow.close();
}
}
}


Expand Down

0 comments on commit 63eed1d

Please sign in to comment.