mirror of
https://github.com/maximebf/php-debugbar.git
synced 2025-01-16 21:08:34 +01:00
Check copy result (#678)
This commit is contained in:
parent
0143b7c17d
commit
0b40a63e63
@ -20,11 +20,12 @@
|
|||||||
var code = $(el).parent('li').find('code').get(0);
|
var code = $(el).parent('li').find('code').get(0);
|
||||||
var copy = function () {
|
var copy = function () {
|
||||||
try {
|
try {
|
||||||
document.execCommand('copy');
|
if (document.execCommand('copy')) {
|
||||||
$(el).addClass(csscls('copy-clipboard-check'));
|
$(el).addClass(csscls('copy-clipboard-check'));
|
||||||
setTimeout(function(){
|
setTimeout(function(){
|
||||||
$(el).removeClass(csscls('copy-clipboard-check'));
|
$(el).removeClass(csscls('copy-clipboard-check'));
|
||||||
}, 2000)
|
}, 2000)
|
||||||
|
}
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.log('Oops, unable to copy');
|
console.log('Oops, unable to copy');
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user