From 63473e54ea6a27b0d7d759cd06ad0ebe9a720e51 Mon Sep 17 00:00:00 2001 From: "Michael J. Rubinsky" Date: Mon, 6 Dec 2010 18:02:44 -0500 Subject: [PATCH] work around jquery(mobile?) bug. elt.parent() returns an empty array when there is no parent (as would be the case when called on the activePage), use this to determine when we can't move upwards anymore, and avoid javascript errors. Also, remove unused variable. --- imp/js/mobile.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/imp/js/mobile.js b/imp/js/mobile.js index 8e4d5e829..a26216df7 100644 --- a/imp/js/mobile.js +++ b/imp/js/mobile.js @@ -211,11 +211,9 @@ var ImpMobile = { */ clickHandler: function(e) { - var elt = $(e.target), - orig = $(e.target), - id; + var elt = $(e.target), id; - while (elt && elt != window.document) { + while (elt && elt != window.document && elt.parent().length) { id = elt.attr('id'); switch (id) { -- 2.11.0