1
0
Fork 0
mirror of https://github.com/Oreolek/ifhub.club.git synced 2024-06-29 04:55:02 +03:00

fix comment js

This commit is contained in:
Mzhelskiy Maxim 2011-08-13 17:33:29 +00:00
parent 9ad850c97b
commit 9f877f188e
3 changed files with 11 additions and 3 deletions

View file

@ -72,6 +72,11 @@ ls.comments = (function ($) {
// Показывает/скрывает форму комментирования
this.toggleCommentForm = function(idComment, bNoFocus) {
$('#comment_preview_'+this.iCurrentShowFormComment).html('').css('display','none');
if (this.iCurrentShowFormComment==idComment && $('#reply_'+idComment).css('display')=='block') {
$('#reply_'+idComment).hide();
return;
}
if (this.options.wysiwyg) {
tinyMCE.execCommand('mceRemoveControl',true,'form_comment_text');
}
@ -80,7 +85,6 @@ ls.comments = (function ($) {
if (!bNoFocus) $('#form_comment_text').focus();
$('#form_comment_reply').val(idComment);
$("#reply_"+idComment).css('display','block');
$('#comment_preview_'+this.iCurrentShowFormComment).html('').css('display','none');
this.iCurrentShowFormComment=idComment;
if (this.options.wysiwyg) {
tinyMCE.execCommand('mceAddControl',true,'form_comment_text');

View file

@ -50,7 +50,7 @@
{$aLang.comment_was_delete}
{/if}
{if $oUserCurrent}
<div class="comment" id="comment_preview_{$oComment->getId()}" style="display: none;"><div class="content"></div></div>
<div class="comment" id="comment_preview_{$oComment->getId()}" style="display: none;"></div>
<div class="reply" id="reply_{$oComment->getId()}" style="display: none;"></div>
{/if}
</div>

View file

@ -72,6 +72,11 @@ ls.comments = (function ($) {
// Показывает/скрывает форму комментирования
this.toggleCommentForm = function(idComment, bNoFocus) {
$('#comment_preview_'+this.iCurrentShowFormComment).html('').css('display','none');
if (this.iCurrentShowFormComment==idComment && $('#reply_'+idComment).css('display')=='block') {
$('#reply_'+idComment).hide();
return;
}
if (this.options.wysiwyg) {
tinyMCE.execCommand('mceRemoveControl',true,'form_comment_text');
}
@ -81,7 +86,6 @@ ls.comments = (function ($) {
$('#form_comment_reply').val(idComment);
$('.reply').hide();
$('#reply_'+idComment).css('display','block');
$('#comment_preview_'+this.iCurrentShowFormComment).html('').css('display','none');
this.iCurrentShowFormComment=idComment;
if (this.options.wysiwyg) {
tinyMCE.execCommand('mceAddControl',true,'form_comment_text');