mirror of
https://github.com/TracksApp/tracks.git
synced 2026-03-14 00:16:15 +01:00
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:
parent
7160825d87
commit
9c7e96e2d3
1 changed files with 3 additions and 2 deletions
|
|
@ -15,6 +15,7 @@ var todoItems = {
|
||||||
var toggleElems = document.getElementsByClassName('container_toggle');
|
var toggleElems = document.getElementsByClassName('container_toggle');
|
||||||
toggleElems.each(function(toggleElem){
|
toggleElems.each(function(toggleElem){
|
||||||
Event.observe(toggleElem, 'click', todoItems.toggleNextActionListing);
|
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");
|
containerElem = todoItems.findNearestParentByClassName(toggleElem, "container");
|
||||||
collapsedCookie = contextCollapseCookieManager.getCookie(todoItems.buildCookieName(containerElem));
|
collapsedCookie = contextCollapseCookieManager.getCookie(todoItems.buildCookieName(containerElem));
|
||||||
if (collapsedCookie)
|
if (collapsedCookie)
|
||||||
|
|
@ -41,8 +42,9 @@ var todoItems = {
|
||||||
new Effect.Fade(fadingElemId,{afterFinish:function(effect) { Element.remove(fadingElemId); }, duration:0.4});
|
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);
|
itemsElem = todoItems.findItemsElem(this);
|
||||||
containerElem = todoItems.findNearestParentByClassName(this, "container");
|
containerElem = todoItems.findNearestParentByClassName(this, "container");
|
||||||
if (Element.visible(itemsElem))
|
if (Element.visible(itemsElem))
|
||||||
|
|
@ -55,7 +57,6 @@ var todoItems = {
|
||||||
todoItems.expandNextActionListing(this, itemsElem);
|
todoItems.expandNextActionListing(this, itemsElem);
|
||||||
contextCollapseCookieManager.clearCookie(todoItems.buildCookieName(containerElem))
|
contextCollapseCookieManager.clearCookie(todoItems.buildCookieName(containerElem))
|
||||||
}
|
}
|
||||||
return false;
|
|
||||||
},
|
},
|
||||||
|
|
||||||
expandNextActionListing: function(toggleElem, itemsElem)
|
expandNextActionListing: function(toggleElem, itemsElem)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue