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

Tweak labels, tab

This commit is contained in:
Barry vd. Heuvel
2024-03-20 20:10:30 +01:00
parent 3adb1e45f6
commit 379acb3c5f

View File

@@ -357,14 +357,14 @@ if (typeof(PhpDebugBar) == 'undefined') {
* @param {String} suffix * @param {String} suffix
* @return {String} * @return {String}
*/ */
format: function(id, data, suffix) { format: function(id, data, suffix, nb) {
if (suffix) { if (suffix) {
suffix = ' ' + suffix; suffix = ' ' + suffix;
} else { } else {
suffix = ''; suffix = '';
} }
var nb = getObjectSize(this.debugbar.datasets) ; var nb = nb || getObjectSize(this.debugbar.datasets) ;
if (typeof(data['__meta']) === 'undefined') { if (typeof(data['__meta']) === 'undefined') {
return "#" + nb + suffix; return "#" + nb + suffix;
@@ -595,6 +595,8 @@ if (typeof(PhpDebugBar) == 'undefined') {
var tab = localStorage.getItem('phpdebugbar-tab'); var tab = localStorage.getItem('phpdebugbar-tab');
if (this.isTab(tab)) { if (this.isTab(tab)) {
this.showTab(tab); this.showTab(tab);
} else {
this.showTab();
} }
} }
} }
@@ -783,6 +785,7 @@ if (typeof(PhpDebugBar) == 'undefined') {
this.$el.removeClass(csscls('minimized')); this.$el.removeClass(csscls('minimized'));
localStorage.setItem('phpdebugbar-visible', '1'); localStorage.setItem('phpdebugbar-visible', '1');
localStorage.setItem('phpdebugbar-tab', name); localStorage.setItem('phpdebugbar-tab', name);
this.resize(); this.resize();
}, },
@@ -946,7 +949,7 @@ if (typeof(PhpDebugBar) == 'undefined') {
data.__meta['suffix'] = suffix; data.__meta['suffix'] = suffix;
this.datasets[id] = data; this.datasets[id] = data;
var label = this.datesetTitleFormater.format(id, this.datasets[id], suffix); var label = this.datesetTitleFormater.format(id, this.datasets[id], suffix, nb);
if (typeof(show) == 'undefined' || show) { if (typeof(show) == 'undefined' || show) {
this.showDataSet(id, label); this.showDataSet(id, label);