1
0
mirror of https://github.com/maximebf/php-debugbar.git synced 2025-07-24 02:01:30 +02:00

Add nb/suffix

This commit is contained in:
Barry vd. Heuvel
2024-03-19 21:34:41 +01:00
parent 8b54ab3750
commit bbff3da233
2 changed files with 13 additions and 4 deletions

View File

@@ -364,7 +364,7 @@ if (typeof(PhpDebugBar) == 'undefined') {
suffix = '';
}
var nb = getObjectSize(this.debugbar.datasets) + 1;
var nb = getObjectSize(this.debugbar.datasets) ;
if (typeof(data['__meta']) === 'undefined') {
return "#" + nb + suffix;
@@ -947,7 +947,10 @@ if (typeof(PhpDebugBar) == 'undefined') {
return;
}
id = id || (getObjectSize(this.datasets) + 1);
var nb = getObjectSize(this.datasets) + 1;
id = id || nb;
data.__meta['nb'] = nb;
data.__meta['suffix'] = suffix;
this.datasets[id] = data;
if (typeof(show) == 'undefined' || show) {

View File

@@ -715,7 +715,12 @@ if (typeof(PhpDebugBar) == 'undefined') {
this.$table = $('<tbody />');
$('<table><thead><tr><th style="width: 175px;">Date</th><th style="width: 80px;">Method</th><th>URL</th><th width="40%">Data</th></tr></thead></table>')
$('<table><thead><tr>' +
'<th style="width: 20px;"></th>' +
'<th style="width: 175px;">Date</th>' +
'<th style="width: 80px;">Method</th>' +
'<th>URL</th><th width="40%">Data</th>' +
'</tr></thead></table>')
.append(this.$table)
.appendTo(this.$el);
@@ -778,9 +783,10 @@ if (typeof(PhpDebugBar) == 'undefined') {
var tr = $('<tr />')
.appendTo(widget.$table)
.attr('data-id', meta['id'])
.append('<td>#' + meta['nb'] + '</td>')
.append('<td>' + meta['datetime'] + '</td>')
.append('<td>' + meta['method'] + '</td>')
.append($('<td />').append(meta['uri']))
.append($('<td />').append(meta['uri'] + (meta['suffix'] ? ' ' + meta['suffix'] : '')))
.css('cursor', 'pointer')
.on('click', function() {
widget.get('debugbar').showDataSet(meta['id']);