mirror of
https://github.com/maximebf/php-debugbar.git
synced 2025-01-16 21:08:34 +01:00
Enable copy, tweak icon
This commit is contained in:
parent
4eb7fd73a1
commit
57645445a2
@ -57,6 +57,10 @@ div.phpdebugbar-widgets-sqlqueries span.phpdebugbar-widgets-stmt-id:before {
|
||||
}
|
||||
div.phpdebugbar-widgets-sqlqueries span.phpdebugbar-widgets-copy-clipboard:before {
|
||||
content: "\f0c5";
|
||||
line-height: 1.5;
|
||||
}
|
||||
div.phpdebugbar-widgets-sqlqueries span.phpdebugbar-widgets-copy-clipboard-check:before {
|
||||
content: "\f46c";
|
||||
}
|
||||
div.phpdebugbar-widgets-sqlqueries a.phpdebugbar-widgets-editor-link:before {
|
||||
content: "\f08e";
|
||||
|
@ -21,7 +21,10 @@
|
||||
var copy = function () {
|
||||
try {
|
||||
document.execCommand('copy');
|
||||
alert('Query copied to the clipboard');
|
||||
$(el).addClass(csscls('copy-clipboard-check'));
|
||||
setTimeout(function(){
|
||||
$(el).removeClass(csscls('copy-clipboard-check'));
|
||||
}, 2000)
|
||||
} catch (err) {
|
||||
console.log('Oops, unable to copy');
|
||||
}
|
||||
@ -116,7 +119,7 @@
|
||||
li.addClass(csscls('error'));
|
||||
li.append($('<span />').addClass(csscls('error')).text("[" + stmt.error_code + "] " + stmt.error_message));
|
||||
}
|
||||
if ((!stmt.type || stmt.type === 'query') && stmt.show_copy !== false) {
|
||||
if ((!stmt.type || stmt.type === 'query')) {
|
||||
$('<span title="Copy to clipboard" />')
|
||||
.addClass(csscls('copy-clipboard'))
|
||||
.css('cursor', 'pointer')
|
||||
|
Loading…
x
Reference in New Issue
Block a user