mirror of
https://github.com/Oreolek/ifhub.club.git
synced 2024-07-02 22:45:02 +03:00
fix tinyMCE в комментариях
This commit is contained in:
parent
ab830d0836
commit
ee9480670f
|
@ -75,18 +75,27 @@ ls.comments = (function ($) {
|
|||
|
||||
// Показывает/скрывает форму комментирования
|
||||
this.toggleCommentForm = function(idComment, bNoFocus) {
|
||||
if (this.iCurrentShowFormComment == idComment && idComment == 0) return;
|
||||
|
||||
var reply=$('#reply');
|
||||
if(!reply.length){
|
||||
return;
|
||||
}
|
||||
$('#comment_preview_' + this.iCurrentShowFormComment).remove();
|
||||
|
||||
if (this.iCurrentShowFormComment==idComment && reply.is(':visible')) {
|
||||
reply.hide();
|
||||
return;
|
||||
}
|
||||
if (this.options.wysiwyg) {
|
||||
tinyMCE.execCommand('mceRemoveControl',true,'form_comment_text');
|
||||
}
|
||||
reply.insertAfter('#comment_id_'+idComment).show();
|
||||
$('#form_comment_text').val('');
|
||||
|
||||
if (this.iCurrentShowFormComment == idComment) idComment = 0;
|
||||
|
||||
$('#reply').insertAfter('#comment_id_'+idComment);
|
||||
$('#form_comment_reply').val(idComment);
|
||||
|
||||
this.iCurrentShowFormComment = idComment;
|
||||
|
||||
if (this.options.wysiwyg) {
|
||||
tinyMCE.execCommand('mceAddControl',true,'form_comment_text');
|
||||
}
|
||||
if (!bNoFocus) $('#form_comment_text').focus();
|
||||
};
|
||||
|
||||
|
@ -306,8 +315,6 @@ ls.comments = (function ($) {
|
|||
this.checkFolding();
|
||||
this.toggleCommentForm(this.iCurrentShowFormComment);
|
||||
|
||||
if (this.options.wysiwyg) tinyMCE.execCommand('mceAddControl',true,'form_comment_text');
|
||||
|
||||
if (typeof(this.options.wysiwyg)!='number') {
|
||||
this.options.wysiwyg = Boolean(BLOG_USE_TINYMCE && tinyMCE);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue