From 4c9d8fd79d806391f68423f004d087035ba60e0a Mon Sep 17 00:00:00 2001 From: marijus Date: Thu, 5 Jun 2014 11:02:27 +0200 Subject: possible fix for 2nd comment collapsing --- view/theme/redbasic/js/redbasic.js | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) (limited to 'view/theme') diff --git a/view/theme/redbasic/js/redbasic.js b/view/theme/redbasic/js/redbasic.js index 58acc1b95..f7f4d3dc2 100644 --- a/view/theme/redbasic/js/redbasic.js +++ b/view/theme/redbasic/js/redbasic.js @@ -1,21 +1,33 @@ function commentOpenRedbasic(obj,id) { - $(document).click(function() { + + $(document).unbind( "click", handler ); + + var handler = function() { if(obj.value == aStr['comment']) { obj.value = ''; $("#comment-edit-text-" + id).addClass("comment-edit-text-full").removeClass("comment-edit-text-empty"); $("#comment-tools-" + id).show(); } - }); + }; + + $(document).bind( "click", handler ); + } function commentCloseRedbasic(obj,id) { - $(document).click(function() { + + $(document).unbind( "click", handler ); + + var handler = function() { if(obj.value == '') { obj.value = aStr['comment']; $("#comment-edit-text-" + id).removeClass("comment-edit-text-full").addClass("comment-edit-text-empty"); $("#comment-tools-" + id).hide(); } - }); + }; + + $(document).bind( "click", handler ); + } $(document).ready(function() { -- cgit v1.2.3