From bbff3da2335dc174e116bcb57b4192f96a0cc870 Mon Sep 17 00:00:00 2001 From: "Barry vd. Heuvel" Date: Tue, 19 Mar 2024 21:34:41 +0100 Subject: [PATCH] Add nb/suffix --- src/DebugBar/Resources/debugbar.js | 7 +++++-- src/DebugBar/Resources/widgets.js | 10 ++++++++-- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/src/DebugBar/Resources/debugbar.js b/src/DebugBar/Resources/debugbar.js index 91d98b7..998dbf3 100644 --- a/src/DebugBar/Resources/debugbar.js +++ b/src/DebugBar/Resources/debugbar.js @@ -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) { diff --git a/src/DebugBar/Resources/widgets.js b/src/DebugBar/Resources/widgets.js index 20d47be..99e8b17 100644 --- a/src/DebugBar/Resources/widgets.js +++ b/src/DebugBar/Resources/widgets.js @@ -715,7 +715,12 @@ if (typeof(PhpDebugBar) == 'undefined') { this.$table = $(''); - $('
DateMethodURLData
') + $('' + + '' + + '' + + '' + + '' + + '
DateMethodURLData
') .append(this.$table) .appendTo(this.$el); @@ -778,9 +783,10 @@ if (typeof(PhpDebugBar) == 'undefined') { var tr = $('') .appendTo(widget.$table) .attr('data-id', meta['id']) + .append('#' + meta['nb'] + '') .append('' + meta['datetime'] + '') .append('' + meta['method'] + '') - .append($('').append(meta['uri'])) + .append($('').append(meta['uri'] + (meta['suffix'] ? ' ' + meta['suffix'] : ''))) .css('cursor', 'pointer') .on('click', function() { widget.get('debugbar').showDataSet(meta['id']);