wiki-grav/plugins/admin/themes/grav/app/forms/fields/text.js
2022-04-24 14:32:58 +02:00

14 lines
417 B
JavaScript

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');
});
});