From 673b8fba4fe7a57175eb621dbb45eaf66f248766 Mon Sep 17 00:00:00 2001 From: Skylar Ittner Date: Sat, 26 Jan 2019 15:19:15 -0700 Subject: [PATCH] Remove tray menu on restartApplication() (close #10) --- www/js/main.js | 1 + www/js/platform.js | 9 +++++++++ 2 files changed, 10 insertions(+) diff --git a/www/js/main.js b/www/js/main.js index 0165af3..334c9c1 100644 --- a/www/js/main.js +++ b/www/js/main.js @@ -41,6 +41,7 @@ function shadeColor2(color, percent) { } function restartApplication() { + removeTrayMenu(); window.location = "index.html"; } diff --git a/www/js/platform.js b/www/js/platform.js index b365f44..f3a868e 100644 --- a/www/js/platform.js +++ b/www/js/platform.js @@ -16,6 +16,10 @@ var setTrayMenu = function (items) { } +var removeTrayMenu = function () { + +} + function initCordova() { platform_type = "cordova"; @@ -78,6 +82,11 @@ function initNW() { icon: 'www/img/logo_64.png' }); + removeTrayMenu = function () { + nw_tray.remove(); + nw_tray = null; + } + setTrayMenu = function (items) { var menu = new nw.Menu(); menu.append(new nw.MenuItem({