From 8929f5840b50f0619bf931ab8e9483b08c1a016d Mon Sep 17 00:00:00 2001 From: "R. Aidan Campbell" Date: Sat, 27 Aug 2016 09:12:55 -0400 Subject: [PATCH] fixed duplicate quit app buttons from appearing --- static/js/index.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/static/js/index.js b/static/js/index.js index 0c3106a..5fef39f 100644 --- a/static/js/index.js +++ b/static/js/index.js @@ -336,8 +336,10 @@ function showApps() { console.log(api.toString()); }); }); - $(".mdl-layout__header-row").append($("
", {html:$(""), class: 'cancel-current', id: 'quitCurrentApp'}).append($("", {html: 'Quit Current App', class:"game-title"}))); - $('#quitCurrentApp').on('click', function() {api.quitApp(); api.refreshServerInfo(); }); + if($('#quitCurrentApp').length === 0) { + $(".mdl-layout__header-row").append($("
", {html:$(""), class: 'cancel-current', id: 'quitCurrentApp'}).append($("", {html: 'Quit Current App', class:"game-title"}))); + $('#quitCurrentApp').on('click', function() {api.quitApp(); api.refreshServerInfo(); }); + } }, function (failedAppList) { console.log('Failed to get applist from host: ' + api.address);