From 694edecda81a3cdf5e98bccfbde9fdfad85c223f Mon Sep 17 00:00:00 2001 From: Andreas Gohr Date: Wed, 9 Apr 2008 19:16:37 +0200 Subject: fixed AJAX in index for IE FS#1367 darcs-hash:20080409171637-7ad00-1a76786332c0b44ae6ff1d1b93007afb02fac97e.gz --- lib/scripts/index.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'lib/scripts') diff --git a/lib/scripts/index.js b/lib/scripts/index.js index 871993c11..4d082898a 100644 --- a/lib/scripts/index.js +++ b/lib/scripts/index.js @@ -25,7 +25,7 @@ index = { var elem = items[i]; // attach action to make the link clickable by AJAX - addEvent(elem,'click',function(event){ return index.toggle(event,this); }); + addEvent(elem,'click',function(e){ return index.toggle(e,this); }); } }, @@ -37,7 +37,7 @@ index = { * @author Andreas Gohr * @author Ben Coburn */ - toggle: function(event,clicky){ + toggle: function(e,clicky){ var listitem = clicky.parentNode.parentNode; // if already open, close by removing the sublist @@ -45,6 +45,7 @@ index = { if(sublists.length && listitem.className=='open'){ sublists[0].style.display='none'; listitem.className='closed'; + e.preventDefault(); return false; } @@ -52,6 +53,7 @@ index = { if(sublists.length && listitem.className=='closed'){ sublists[0].style.display=''; listitem.className='open'; + e.preventDefault(); return false; } @@ -80,8 +82,8 @@ index = { } }; ajax.runAJAX(clicky.search.substr(1)+'&call=index'); + e.preventDefault(); return false; - } }; -- cgit v1.2.3