mirror of
https://github.com/Oreolek/ifhub.club.git
synced 2024-07-01 14:05:07 +03:00
fix comment js
This commit is contained in:
parent
9ad850c97b
commit
9f877f188e
|
@ -72,6 +72,11 @@ ls.comments = (function ($) {
|
||||||
|
|
||||||
// Показывает/скрывает форму комментирования
|
// Показывает/скрывает форму комментирования
|
||||||
this.toggleCommentForm = function(idComment, bNoFocus) {
|
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) {
|
if (this.options.wysiwyg) {
|
||||||
tinyMCE.execCommand('mceRemoveControl',true,'form_comment_text');
|
tinyMCE.execCommand('mceRemoveControl',true,'form_comment_text');
|
||||||
}
|
}
|
||||||
|
@ -80,7 +85,6 @@ ls.comments = (function ($) {
|
||||||
if (!bNoFocus) $('#form_comment_text').focus();
|
if (!bNoFocus) $('#form_comment_text').focus();
|
||||||
$('#form_comment_reply').val(idComment);
|
$('#form_comment_reply').val(idComment);
|
||||||
$("#reply_"+idComment).css('display','block');
|
$("#reply_"+idComment).css('display','block');
|
||||||
$('#comment_preview_'+this.iCurrentShowFormComment).html('').css('display','none');
|
|
||||||
this.iCurrentShowFormComment=idComment;
|
this.iCurrentShowFormComment=idComment;
|
||||||
if (this.options.wysiwyg) {
|
if (this.options.wysiwyg) {
|
||||||
tinyMCE.execCommand('mceAddControl',true,'form_comment_text');
|
tinyMCE.execCommand('mceAddControl',true,'form_comment_text');
|
||||||
|
|
|
@ -50,7 +50,7 @@
|
||||||
{$aLang.comment_was_delete}
|
{$aLang.comment_was_delete}
|
||||||
{/if}
|
{/if}
|
||||||
{if $oUserCurrent}
|
{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>
|
<div class="reply" id="reply_{$oComment->getId()}" style="display: none;"></div>
|
||||||
{/if}
|
{/if}
|
||||||
</div>
|
</div>
|
|
@ -72,6 +72,11 @@ ls.comments = (function ($) {
|
||||||
|
|
||||||
// Показывает/скрывает форму комментирования
|
// Показывает/скрывает форму комментирования
|
||||||
this.toggleCommentForm = function(idComment, bNoFocus) {
|
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) {
|
if (this.options.wysiwyg) {
|
||||||
tinyMCE.execCommand('mceRemoveControl',true,'form_comment_text');
|
tinyMCE.execCommand('mceRemoveControl',true,'form_comment_text');
|
||||||
}
|
}
|
||||||
|
@ -81,7 +86,6 @@ ls.comments = (function ($) {
|
||||||
$('#form_comment_reply').val(idComment);
|
$('#form_comment_reply').val(idComment);
|
||||||
$('.reply').hide();
|
$('.reply').hide();
|
||||||
$('#reply_'+idComment).css('display','block');
|
$('#reply_'+idComment).css('display','block');
|
||||||
$('#comment_preview_'+this.iCurrentShowFormComment).html('').css('display','none');
|
|
||||||
this.iCurrentShowFormComment=idComment;
|
this.iCurrentShowFormComment=idComment;
|
||||||
if (this.options.wysiwyg) {
|
if (this.options.wysiwyg) {
|
||||||
tinyMCE.execCommand('mceAddControl',true,'form_comment_text');
|
tinyMCE.execCommand('mceAddControl',true,'form_comment_text');
|
||||||
|
|
Loading…
Reference in a new issue