From bf88720fae18f0ffc2824cf94c262e5dc9c907ec Mon Sep 17 00:00:00 2001 From: marijus Date: Sat, 24 May 2014 17:50:09 +0200 Subject: possible fix for empty commentbox colapsing on tool-button click --- view/js/main.js | 21 +++++++++------------ view/theme/redbasic/js/redbasic.js | 10 ++++++++++ view/tpl/comment_item.tpl | 2 +- 3 files changed, 20 insertions(+), 13 deletions(-) diff --git a/view/js/main.js b/view/js/main.js index b388ab940..2f695c77e 100644 --- a/view/js/main.js +++ b/view/js/main.js @@ -13,18 +13,15 @@ } function commentClose(obj,id) { - //$(document).on('click', function() { - if(obj.value == '') { - obj.value = aStr['comment']; - $("#comment-edit-text-" + id).removeClass("comment-edit-text-full"); - $("#comment-edit-text-" + id).addClass("comment-edit-text-empty"); - $("#mod-cmnt-wrap-" + id).hide(); - closeMenu("comment-tools-" + id); - return true; - } - return false; - //}); - + if(obj.value == '') { + obj.value = aStr['comment']; + $("#comment-edit-text-" + id).removeClass("comment-edit-text-full"); + $("#comment-edit-text-" + id).addClass("comment-edit-text-empty"); + $("#mod-cmnt-wrap-" + id).hide(); + closeMenu("comment-tools-" + id); + return true; + } + return false; } function showHideCommentBox(id) { diff --git a/view/theme/redbasic/js/redbasic.js b/view/theme/redbasic/js/redbasic.js index d981b0c11..d4349df61 100644 --- a/view/theme/redbasic/js/redbasic.js +++ b/view/theme/redbasic/js/redbasic.js @@ -1,3 +1,13 @@ +function commentCloseRed(obj,id) { + $(document).click(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).ready(function() { $('#expand-aside').click(function() { diff --git a/view/tpl/comment_item.tpl b/view/tpl/comment_item.tpl index 121cf0995..7d7b22f74 100755 --- a/view/tpl/comment_item.tpl +++ b/view/tpl/comment_item.tpl @@ -10,7 +10,7 @@ - + {{if $qcomment}} - + {{if $qcomment}} - + {{if $qcomment}}