From: Michael J. Rubinsky Date: Mon, 6 Dec 2010 23:02:44 +0000 (-0500) Subject: work around jquery(mobile?) bug. X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=63473e54ea6a27b0d7d759cd06ad0ebe9a720e51;p=horde.git 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. --- 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) {