Соединенные Штаты Америки
Выбери страну
Выбор страны влияет на выдачу акций и магазинов
Опубликовано 12 недель назад
Опубликовано 12 недель назад
10 Pcs New Red Star Snap Clip for Girl Waterdrop Barrettes Black Hairpin Women Silver Hair Clip Accessories Kawaii BB Clip
85 ₽
Авто
Подробнее о скидке
');
$('#comment' + data.id).fadeIn("slow");
});
});
}else{
window.content43t34tg3w4efg = $( data.content + '\')
$('#ansvers-'+$id).append($( data.content + '\'))
node = $("#blind-animation-" + data.id);
scrollToCenterPosition('#ansvers-'+$id, function() {
$(node).show('blind',{},500);
});
}
tinymce.activeEditor.setContent('');
form.comments.value = ''
$(form).closest('.answerForm').html('');
}else{
if(data.msg){
$.notify(data.msg, "error");
}
}
}, 'json').fail(function() {
loader.style.background = 'white';
loader.classList.add('preloader-finish');
$.notify("Неизвестная ошибка", "error");
});
return false;
}
function ProcessAddComments(){
tinymce.triggerSave();
var form = document.getElementById('new-addcomment-form');
if (form.comments.value == '')
{
$.notify("Заполните поле с комментарием", "error");
return false;
}
let loader = document.querySelector('#loader-wrapper');
loader.style.background = 'transparent';
loader.classList.remove('preloader-finish');
$.post("/ajax/comments/", { action:'addcomment', post_id: form.post_id.value, post_type: form.post_type.value, comments: form.comments.value}, function(data){
loader.style.background = 'white';
loader.classList.add('preloader-finish');
if( data.status ) {
if ($('#comment' + data.id ).length) {
var content = $( data.content ).html();
scrollToCenterPosition('#comment' + data.id, function() {
$( '#comment' + data.id ).fadeOut("slow", function(){
$(this).html(content + '\');
$('#comment' + data.id).fadeIn("slow");
});
});
} else {
$( data.content + '\').insertBefore('#ajax-comments');
node = $("#blind-animation-" + data.id);
scrollToCenterPosition('#ajax-comments', function() {
$(node).show('blind',{},500);
});
}
tinymce.activeEditor.setContent('');
form.comments.value = ''
}else{
if(data.msg){
$.notify(data.msg, "error");
}
}
}, 'json').fail(function() {
loader.style.background = 'white';
loader.classList.add('preloader-finish');
$.notify("Неизвестная ошибка", "error");
});
return false;
}
function scrollToCenterPosition(id, callback, time) {
console.log(id);
console.log(time);
var node = $(id);
console.log(node);
var offset = node.offset().top;
var windowHeight = $(window).height();
var elementHeight = node.outerHeight();
var scrollPosition;
if (typeof time == 'undefined') {
var time = 400;
}
if (elementHeight > (windowHeight - 100) || elementHeight == 0) {
scrollPosition = offset - (windowHeight / 4) ;
} else {
scrollPosition = offset - (windowHeight / 2) + (elementHeight / 2);
}
if (typeof callback == 'undefined' || callback == null) {
$("html,body").stop().animate({ scrollTop: scrollPosition }, time);
} else {
$("html,body").stop().animate({ scrollTop: scrollPosition }, time, callback);
}
};
