Collapsing contexts was allowing the link clicked to be processed, and since the href just consists of "#", the page would scroll to the top. This commit fixes that problem.

git-svn-id: http://www.rousette.org.uk/svn/tracks-repos/trunk@273 a4c988fc-2ded-0310-b66e-134b36920a42
This commit is contained in:
lukemelia 2006-06-30 03:27:48 +00:00
parent 7160825d87
commit 9c7e96e2d3

View file

@ -15,6 +15,7 @@ var todoItems = {
var toggleElems = document.getElementsByClassName('container_toggle');
toggleElems.each(function(toggleElem){
Event.observe(toggleElem, 'click', todoItems.toggleNextActionListing);
toggleElem.onclick = function() {return false;}; //workaround for Event.stop problem with Safari 2.0.3. See http://particletree.com/notebook/eventstop/
containerElem = todoItems.findNearestParentByClassName(toggleElem, "container");
collapsedCookie = contextCollapseCookieManager.getCookie(todoItems.buildCookieName(containerElem));
if (collapsedCookie)
@ -41,8 +42,9 @@ var todoItems = {
new Effect.Fade(fadingElemId,{afterFinish:function(effect) { Element.remove(fadingElemId); }, duration:0.4});
},
toggleNextActionListing: function()
toggleNextActionListing: function(event)
{
Event.stop(event);
itemsElem = todoItems.findItemsElem(this);
containerElem = todoItems.findNearestParentByClassName(this, "container");
if (Element.visible(itemsElem))
@ -55,7 +57,6 @@ var todoItems = {
todoItems.expandNextActionListing(this, itemsElem);
contextCollapseCookieManager.clearCookie(todoItems.buildCookieName(containerElem))
}
return false;
},
expandNextActionListing: function(toggleElem, itemsElem)