From 6049919e465f74fc2b97b186009336f316bf0f2b Mon Sep 17 00:00:00 2001 From: lengstrom Date: Sat, 26 Sep 2015 01:46:05 -0400 Subject: [PATCH] fixed openSideBar fading --- js/initialization.js | 2 +- js/main.js | 12 +++++++----- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/js/initialization.js b/js/initialization.js index 64d0e66..47a3300 100644 --- a/js/initialization.js +++ b/js/initialization.js @@ -249,7 +249,7 @@ function startBtnHandler() { if (importing == 1) { init(1); - checkVisualElements(); + checkVisualElements(0); } else { resumeGame(); } diff --git a/js/main.js b/js/main.js index afc8515..04e36d2 100644 --- a/js/main.js +++ b/js/main.js @@ -70,11 +70,11 @@ function resumeGame() { } }, 7000); - checkVisualElements(); + checkVisualElements(0); } -function checkVisualElements() { - if ($('#openSideBar').is(":visible")) $('#openSideBar').fadeOut(150, "linear"); +function checkVisualElements(arg) { + if (arg && $('#openSideBar').is(":visible")) $('#openSideBar').fadeOut(150, "linear"); if (!$('#pauseBtn').is(':visible')) $('#pauseBtn').fadeIn(150, "linear"); $('#fork-ribbon').fadeOut(150); if (!$('#restartBtn').is(':visible')) $('#restartBtn').fadeOut(150, "linear"); @@ -96,11 +96,13 @@ function init(b) { } setTimeout(function() { - $('#openSideBar').fadeOut(150, "linear"); + if (gameState == 1) { + $('#openSideBar').fadeOut(150, "linear"); + } infobuttonfading = false; }, 7000); clearSaveState(); - checkVisualElements(); + checkVisualElements(1); } if (highscores.length === 0 ){ $("#currentHighScore").text(0);