jQuery(function($){
$(document).ready(function(){
$('#top').click(function(event){
event.preventDefault();
$('html, body').animate({ scrollTop: 0 }, 200);
});
$(window).on("scroll", function(){
const scrollTop=$(this).scrollTop();
const rightElement=$("#top");
const navigationElement=$('#navigation');
if(scrollTop < 500){
rightElement.hide();
}else if(scrollTop > 500&&!navigationElement.hasClass("scrll")){
rightElement.css("display", "flex");
}});
});
});
jQuery(function($){
$(document).ready(function(){
copy_control();
$('#commentform textarea').on('click', function(){
$('.form-submit input').show();
});
});
async function copy_control(){
$('#single .post').on('copy', function(e){
var selectedText=window.getSelection().toString();
var currentUrl=window.location.href;
if(selectedText.length > 150){
var modifiedText=selectedText + '\n\nИсточник: ' + currentUrl;
e.originalEvent.clipboardData.setData('text/plain', modifiedText);
e.preventDefault();
}});
}
});