|
31 | 31 | var isCopied = false; |
32 | 32 | try { |
33 | 33 | isCopied = document.execCommand('copy'); |
34 | | - alert('Query copied to the clipboard'); |
| 34 | + console.log('Query copied to the clipboard'); |
35 | 35 | } catch (err) { |
36 | | - console.log('Oops, unable to copy'); |
| 36 | + alert('Oops, unable to copy'); |
37 | 37 | } |
38 | 38 |
|
39 | 39 | window.getSelection().removeAllRanges(); |
|
280 | 280 | $li.append($('<span title="Connection" />').addClass(csscls('database')).text(statement.connection)); |
281 | 281 | } |
282 | 282 | if (statement.xdebug_link) { |
283 | | - const $header = $('<span title="Filename" />') |
| 283 | + $('<span title="Filename" />') |
284 | 284 | .addClass(csscls('filename')) |
285 | | - .text(statement.xdebug_link.line ? `${statement.xdebug_link.filename}#${statement.xdebug_link.line}` : statement.xdebug_link.filename); |
286 | | - |
287 | | - if (statement.xdebug_link.ajax) { |
288 | | - $header.append( |
289 | | - $('<a/>') |
290 | | - .attr('title', statement.xdebug_link.url) |
291 | | - .addClass(csscls('editor-link')) |
292 | | - .on('click', () => fetch(statement.xdebug_link.url)) |
293 | | - ); |
294 | | - } else { |
295 | | - $header.append( |
296 | | - $('<a/>') |
297 | | - .attr('href', statement.xdebug_link.url) |
298 | | - .addClass(csscls('editor-link')) |
299 | | - ); |
300 | | - } |
301 | | - $li.append($header); |
| 285 | + .text(statement.xdebug_link.filename + '#' + (statement.xdebug_link.line || '?')) |
| 286 | + .append($('<a/>') |
| 287 | + .attr('href', statement.xdebug_link.url) |
| 288 | + .addClass(csscls('editor-link')) |
| 289 | + .on('click', event => { |
| 290 | + event.stopPropagation(); |
| 291 | + if (statement.xdebug_link.ajax) { |
| 292 | + event.preventDefault(); |
| 293 | + fetch(statement.xdebug_link.url); |
| 294 | + } |
| 295 | + }) |
| 296 | + ).appendTo($li); |
302 | 297 | } |
303 | 298 |
|
304 | 299 | const $details = $('<table></table>').addClass(csscls('params')) |
|
0 commit comments