From 796d67880df12018920ea6e99f8ee830c6a781e9 Mon Sep 17 00:00:00 2001 From: mossroy Date: Sun, 4 Aug 2013 12:35:55 +0200 Subject: [PATCH] Small fix on hyperlinks inside an article, so that the content does not "scroll" by one line at the moment you click --- js/app.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/js/app.js b/js/app.js index 0e8530d0..186cbd0e 100644 --- a/js/app.js +++ b/js/app.js @@ -185,7 +185,6 @@ define(function(require) { /** * Handle key input in the prefix input zone * @param {type} evt - * @returns {undefined} */ function onKeyUpPrefix(evt) { // Use a timeout, so that very quick typing does not cause a lot of overhead @@ -398,14 +397,14 @@ define(function(require) { * @returns {undefined} */ function goToArticle(titleName) { - $("#articleName").html(titleName); - $("#readingArticle").show(); localArchive.getTitleByName(titleName, function(title) { - if (title == null) { + if (title === null || title === undefined) { $("#readingArticle").hide(); alert("Article with title " + titleName + " not found in the archive"); } else { + $("#articleName").html(titleName); + $("#readingArticle").show(); $("#articleContent").html(""); readArticle(title); }