Skip to content
Browse files

maintaining previous background color on click in search preview

  • Loading branch information...
1 parent 01b6bbf commit d06d76182ca86ef106276ba3b008d7ae9642e2e1 Jared Williams committed Jan 7, 2011
Showing with 2 additions and 1 deletion.
  1. +2 −1 src/main/webapp/js/search-preview.js
View
3 src/main/webapp/js/search-preview.js
@@ -20,6 +20,7 @@ $(document).ready(function() {
position -= 40;
}
currentParent = $(this).closest('span').parent();
+ currentParent.attr('old-background', currentParent.css('background'));
currentParent.css('background', '#E2DED5');
$('html,body').animate({scrollTop:position},500);
$('.search_preview').css('margin-top', position);
@@ -29,7 +30,7 @@ $(document).ready(function() {
writeToSearchBox = (function(person) {
if (currentParent != previousParent || previousParent == '') {
if (previousParent != '') {
- previousParent.css('background', '#fff');
+ previousParent.css('background', currentParent.attr('old-background') /*'#fff'*/);
}
previousParent = currentParent;
}

0 comments on commit d06d761

Please sign in to comment.
Something went wrong with that request. Please try again.