From c2ec8f377e9d54d6e73275247d539e3598f41381 Mon Sep 17 00:00:00 2001 From: "R. Aidan Campbell" Date: Sun, 8 Oct 2017 10:06:13 -0700 Subject: [PATCH] Fixed bug where clicking game would do nothing --- static/js/index.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/static/js/index.js b/static/js/index.js index 0960edc..188f814 100644 --- a/static/js/index.js +++ b/static/js/index.js @@ -447,9 +447,8 @@ function showApps(host) { appList.forEach(function (app) { host.getBoxArt(app.id).then(function (resolvedPromise) { - let app_selector = $('#game-' + app.id); // put the box art into the image holder - if (app_selector.length === 0) { + if ($('#game-' + app.id).length === 0) { // double clicking the button will cause multiple box arts to appear. // to mitigate this we ensure we don't add a duplicate. // This isn't perfect: there's lots of RTTs before the logic prevents anything @@ -473,10 +472,10 @@ function showApps(host) { // $("#gameList").append($("
", {html:$("", {src: URL.createObjectURL(imageBlob), id: 'game-'+app.id, name: app.title }), class: 'box-art mdl-cell mdl-cell--3-col'}).append($("", {html: app.title, class:"game-title"}))); - app_selector.on('click', function () { + $('#game-' + app.id).on('click', function () { startGame(host, app.id); }); - app_selector.keypress(function (e) { + $('#game-' + app.id).keypress(function (e) { if (e.keyCode === 13) { startGame(host, app.id); }