diff options
author | RedMatrix <info@friendica.com> | 2014-05-25 07:46:42 +1000 |
---|---|---|
committer | RedMatrix <info@friendica.com> | 2014-05-25 07:46:42 +1000 |
commit | e6015e71697bb700aab5e5165f9d66a8cbfcab7a (patch) | |
tree | 7120287e1937ce45fd788ca003732e10974da1ce | |
parent | 1879a8b747fb7d170d11700310a9384084b7caee (diff) | |
parent | 2bdecdce17057e4464f54918ad17d48071006161 (diff) | |
download | volse-hubzilla-e6015e71697bb700aab5e5165f9d66a8cbfcab7a.tar.gz volse-hubzilla-e6015e71697bb700aab5e5165f9d66a8cbfcab7a.tar.bz2 volse-hubzilla-e6015e71697bb700aab5e5165f9d66a8cbfcab7a.zip |
Merge pull request #473 from git-marijus/master
possible fix for empty commentbox collapsing on tool-button click
-rw-r--r-- | view/js/main.js | 21 | ||||
-rw-r--r-- | view/theme/redbasic/js/redbasic.js | 20 | ||||
-rwxr-xr-x | view/tpl/comment_item.tpl | 2 |
3 files changed, 30 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..58acc1b95 100644 --- a/view/theme/redbasic/js/redbasic.js +++ b/view/theme/redbasic/js/redbasic.js @@ -1,3 +1,23 @@ +function commentOpenRedbasic(obj,id) { + $(document).click(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(); + } + }); +} + +function commentCloseRedbasic(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..0b89bb16a 100755 --- a/view/tpl/comment_item.tpl +++ b/view/tpl/comment_item.tpl @@ -10,7 +10,7 @@ <input type="hidden" name="return" value="{{$return_path}}" /> <input type="hidden" name="jsreload" value="{{$jsreload}}" /> <input type="hidden" name="preview" id="comment-preview-inp-{{$id}}" value="0" /> - <textarea id="comment-edit-text-{{$id}}" class="comment-edit-text-empty" name="body" onFocus="commentOpen(this,{{$id}});" onBlur="commentClose(this,{{$id}});" >{{$comment}}</textarea> + <textarea id="comment-edit-text-{{$id}}" class="comment-edit-text-empty" name="body" onFocus="commentOpenRedbasic(this,{{$id}});" onBlur="commentCloseRedbasic(this,{{$id}});" >{{$comment}}</textarea> {{if $qcomment}} <select id="qcomment-select-{{$id}}" name="qcomment-{{$id}}" class="qcomment" onchange="qCommentInsert(this,{{$id}});" > <option value=""></option> |