1
0
mirror of https://github.com/maximebf/php-debugbar.git synced 2025-07-25 18:51:42 +02:00

Tweak labels, tab

This commit is contained in:
Barry vd. Heuvel
2024-03-20 20:10:30 +01:00
parent 57415de260
commit 4835dc6688

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();
} }
} }
} }
@@ -631,7 +633,7 @@ if (typeof(PhpDebugBar) == 'undefined') {
} }
var self = this; var self = this;
tab.$tab.appendTo( this.$headerLeft).click(function() { tab.$tab.appendTo(this.$headerLeft).click(function() {
if (!self.isMinimized() && self.activePanelName == name) { if (!self.isMinimized() && self.activePanelName == name) {
self.minimize(); self.minimize();
} else { } else {
@@ -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);