mirror of
https://github.com/maximebf/php-debugbar.git
synced 2025-01-16 13:00:42 +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 copy = function () {
|
||||
try {
|
||||
document.execCommand('copy');
|
||||
$(el).addClass(csscls('copy-clipboard-check'));
|
||||
setTimeout(function(){
|
||||
$(el).removeClass(csscls('copy-clipboard-check'));
|
||||
}, 2000)
|
||||
if (document.execCommand('copy')) {
|
||||
$(el).addClass(csscls('copy-clipboard-check'));
|
||||
setTimeout(function(){
|
||||
$(el).removeClass(csscls('copy-clipboard-check'));
|
||||
}, 2000)
|
||||
}
|
||||
} catch (err) {
|
||||
console.log('Oops, unable to copy');
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user