From 505e23beac53a33fb3f0cd4bed2ecb6f322be162 Mon Sep 17 00:00:00 2001 From: Ray Schamp Date: Thu, 7 May 2015 17:06:58 -0400 Subject: [PATCH] Don't go to pages that don't exist --- js/scratchx.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/js/scratchx.js b/js/scratchx.js index 1496b41..eaca887 100644 --- a/js/scratchx.js +++ b/js/scratchx.js @@ -320,6 +320,8 @@ function showPage(path) { var toShow = "#" + path; var $toShow = $(toShow); + if (!$toShow.length) return; + $(toHide).filter(":visible").hide(); if (toShow != "#editor") $("#editor").css({top: "-9999px"}); $("body > main, body > main > article").has($toShow).show();