diff --git a/index.html b/index.html
index 53750593..bdd33621 100644
--- a/index.html
+++ b/index.html
@@ -56,10 +56,9 @@
Looks like you haven't pinned any games, click the star icon next to any game in order to pin them up here!
All Games
Please wait for the games to load.. If you see this for more than a second, try reloading and reporting a bug report.
diff --git a/js/games.js b/js/games.js
index 9108d64f..cc327f51 100644
--- a/js/games.js
+++ b/js/games.js
@@ -11,7 +11,6 @@ $.getJSON("/games.json", function (data) {
$("#gamesearch").prop({placeholder: "Click here to search through our " + data.length + " games!"});
data.sort(dynamicSort("name"));
for (let i = 0; i < data.length; i++) {
- console.log("Loop iteration:", i);
let $element = $('
').prop({
class: 'game',
style: 'cursor: pointer;',
@@ -34,7 +33,7 @@ $.getJSON("/games.json", function (data) {
let $pinnedelement = $element.clone();
$('#pinnedgames').append($pinnedelement);
if($("#pinnedgames #message")) {
- $("#pinnedgames #message").hide();
+ $("#pinnedmessage").hide();
}
}
@@ -61,17 +60,18 @@ $(document).ready(function() {
Cookies.set("starred", JSON.stringify(starred));
$element = $(this).clone();
$('#pinnedgames').append($element);
- $("#pinnedgames #message").hide();
+ $("#pinnedmessage").hide();
} else {
$(event.target).removeAttr("id");
$thisdiv = '#' + $(this).attr("id")
starred = Cookies.get("starred")
starred = JSON.parse(starred);
- starred.pop(starred.indexOf($(this).attr("dir")), starred.indexOf($(this).attr("dir")));
+ ourindex = starred.indexOf($(this).attr("id"));
+ starred.splice(ourindex, 1);
Cookies.set("starred", JSON.stringify(starred));
$("#pinnedgames " + $thisdiv).remove();
- if(!$("#pinnedgames div") == "") {
- $("#pinnedgames #message").show();
+ if($('#pinnedgames').is(':empty')) {
+ $("#pinnedmessage").show();
}
$($thisdiv + " #starred").removeAttr("id");
}