From 82677e5d32f86b6cece3cc5ae819a026875792cf Mon Sep 17 00:00:00 2001 From: Taka Date: Sun, 5 May 2019 03:53:27 +0000 Subject: [PATCH] Don't ask the user to confirm leaving the page if we're running inside the desktop app. --- vasl_templates/webapp/static/main.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/vasl_templates/webapp/static/main.js b/vasl_templates/webapp/static/main.js index e029917..c1dc007 100644 --- a/vasl_templates/webapp/static/main.js +++ b/vasl_templates/webapp/static/main.js @@ -361,7 +361,9 @@ $(document).ready( function () { // check for a dirty scenario before leaving the page if ( ! getUrlParam( "disable_close_window_check" ) ) { window.addEventListener( "beforeunload", function(evt) { - if ( is_scenario_dirty() ) { + // NOTE: We don't check for this if we're running inside the desktop app, since it will intercept the click + // and open the page in a new external browser window (see AppWebPage.acceptNavigationRequest()). + if ( !gWebChannelHandler && is_scenario_dirty() ) { evt.returnValue = "This scenario has been changed. Do you want to leave the page, and lose your changes?" ; return evt.returnValue ; }