From: Jan Schneider Date: Thu, 18 Mar 2010 15:03:36 +0000 (+0100) Subject: Use up() instead of parentNode, and $w() instead of string arrays. X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=d3b491d69b2201df174c39b56dcd2a2db1c9e881;p=horde.git Use up() instead of parentNode, and $w() instead of string arrays. --- diff --git a/kronolith/js/kronolith.js b/kronolith/js/kronolith.js index 8fa92e38c..8a3f0b1bb 100644 --- a/kronolith/js/kronolith.js +++ b/kronolith/js/kronolith.js @@ -323,14 +323,14 @@ KronolithCore = { case 'tasks': var tasktype = locParts.shift() || this.tasktype; if ((this.view == loc && this.tasktype == tasktype) || - !([ 'all', 'complete', 'incomplete', 'future' ].include(tasktype))) { + !($w('all complete incomplete future').include(tasktype))) { return; } this.tasktype = tasktype; - [ 'All', 'Complete', 'Incomplete', 'Future' ].each(function(tasktype) { - $($('kronolithTasks' + tasktype).parentNode).removeClassName('activeTab'); + $w('All Complete Incomplete Future').each(function(tasktype) { + $('kronolithTasks' + tasktype).up().removeClassName('activeTab'); }); - $('kronolithTasks' + this.tasktype.capitalize()).parentNode.addClassName('activeTab'); + $('kronolithTasks' + this.tasktype.capitalize()).up().addClassName('activeTab'); this.loadTasks(this.tasktype); if ($('kronolithView' + locCap)) { this.viewLoading = true; @@ -1103,7 +1103,7 @@ KronolithCore = { dialog.select('.kronolithTabsOption').invoke('hide'); dialog.select('.tabset li').invoke('removeClassName', 'activeTab'); $(elt.id.replace(/Link/, 'Tab')).show(); - elt.parentNode.addClassName('activeTab'); + elt.up().addClassName('activeTab'); if (elt.id == 'kronolithEventLinkMap') { /* Maps */ if (!this.mapInitialized) { @@ -3867,7 +3867,7 @@ KronolithCore = { start = viewDates[0].toString('yyyyMMdd'), end = viewDates[1].toString('yyyyMMdd'); - if (drop == el.parentNode) { + if (drop == el.up()) { return; } @@ -4653,7 +4653,7 @@ KronolithCore = { dialog.select('.kronolithTabsOption').invoke('hide'); dialog.select('.tabset li').invoke('removeClassName', 'activeTab'); $('kronolithEventTabMap').show(); - $('kronolithEventLinkMap').parentNode.addClassName('activeTab'); + $('kronolithEventLinkMap').up().addClassName('activeTab'); }, /**