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.
*/
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) {