From 98679cfb1bff42bb4ce47892efa993ec3dfc1b9a Mon Sep 17 00:00:00 2001 From: Reinier Balt Date: Tue, 8 Feb 2011 22:55:50 +0100 Subject: [PATCH] fix #1076 where the anchor was not stopped from being followed after clicking expand/collapse --- public/javascripts/application.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/public/javascripts/application.js b/public/javascripts/application.js index e373002a..d1e24a5e 100644 --- a/public/javascripts/application.js +++ b/public/javascripts/application.js @@ -258,13 +258,15 @@ var TodoItemsContainer = { imgSrc = $(this).find('img').attr('src'); $(this).find('img').attr('src', imgSrc.replace('collapse', 'expand')); $.cookie(TodoItemsContainer.buildCookieName(this.parentNode.parentNode), true); + toggle_target.slideUp(500); } else { // show it imgSrc = $(this).find('img').attr('src'); $(this).find('img').attr('src', imgSrc.replace('expand', 'collapse')); $.cookie(TodoItemsContainer.buildCookieName(this.parentNode.parentNode), null); + toggle_target.slideDown(500); } - toggle_target.toggle('blind'); + return false; }); // set to cookied state $('.container.context').each(function(){