webseite-grav/plugins/admin/themes/grav/app/forms/fields/text.js

14 lines
417 B
JavaScript
Raw Normal View History

2021-04-30 11:23:26 +02:00
import $ from 'jquery';
$(document).ready(function() {
$('.copy-to-clipboard').click(function(event) {
var $tempElement = $('<input>');
$('body').append($tempElement);
$tempElement.val($(this).prev('input').val()).select();
document.execCommand('Copy');
$tempElement.remove();
$(this).attr('data-hint', 'Copied to clipboard!').addClass('hint--left');
});
});