mirror of
https://github.com/maximebf/php-debugbar.git
synced 2025-07-25 10:41:55 +02:00
Track history
This commit is contained in:
@@ -421,6 +421,7 @@ if (typeof(PhpDebugBar) == 'undefined') {
|
|||||||
this.dataMap = {};
|
this.dataMap = {};
|
||||||
this.datasets = {};
|
this.datasets = {};
|
||||||
this.firstTabName = null;
|
this.firstTabName = null;
|
||||||
|
this.previousPanelName = null;
|
||||||
this.activePanelName = null;
|
this.activePanelName = null;
|
||||||
this.activeDatasetId = null;
|
this.activeDatasetId = null;
|
||||||
this.datesetTitleFormater = new DatasetTitleFormater(this);
|
this.datesetTitleFormater = new DatasetTitleFormater(this);
|
||||||
@@ -785,6 +786,7 @@ if (typeof(PhpDebugBar) == 'undefined') {
|
|||||||
|
|
||||||
this.controls[name].$tab.addClass(csscls('active'));
|
this.controls[name].$tab.addClass(csscls('active'));
|
||||||
this.controls[name].$el.addClass(csscls('active'));
|
this.controls[name].$el.addClass(csscls('active'));
|
||||||
|
this.previousPanelName = this.activePanelName;
|
||||||
this.activePanelName = name;
|
this.activePanelName = name;
|
||||||
|
|
||||||
this.$el.removeClass(csscls('minimized'));
|
this.$el.removeClass(csscls('minimized'));
|
||||||
|
@@ -790,25 +790,33 @@ if (typeof(PhpDebugBar) == 'undefined') {
|
|||||||
|
|
||||||
var $badges = $('<td />');
|
var $badges = $('<td />');
|
||||||
var tr = $('<tr />');
|
var tr = $('<tr />');
|
||||||
console.log('sorting ' , widget.get('sort'));
|
|
||||||
if (widget.get('sort') === 'asc') {
|
if (widget.get('sort') === 'asc') {
|
||||||
tr.appendTo(widget.$table);
|
tr.appendTo(widget.$table);
|
||||||
} else {
|
} else {
|
||||||
console.log('prepend');
|
|
||||||
tr.prependTo(widget.$table);
|
tr.prependTo(widget.$table);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var clickHandler = function() {
|
||||||
|
var debugbar = widget.get('debugbar');
|
||||||
|
debugbar.showDataSet(meta['id']);
|
||||||
|
widget.$table.find('.' + csscls('active')).removeClass(csscls('active'));
|
||||||
|
tr.addClass(csscls('active'));
|
||||||
|
|
||||||
|
if ($(this).data('tab')) {
|
||||||
|
debugbar.showTab($(this).data('tab'));
|
||||||
|
} else if (debugbar.previousPanelName) {
|
||||||
|
debugbar.showTab(debugbar.previousPanelName);
|
||||||
|
} else {
|
||||||
|
debugbar.showTab(debugbar.firstTabName);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
tr.attr('data-id', meta['id'])
|
tr.attr('data-id', meta['id'])
|
||||||
.append('<td>#' + meta['nb'] + '</td>')
|
.append($('<td>#' + meta['nb'] + '</td>').click(clickHandler))
|
||||||
.append('<td>' + meta['datetime'] + '</td>')
|
.append($('<td>' + meta['datetime'] + '</td>').click(clickHandler))
|
||||||
.append('<td>' + meta['method'] + '</td>')
|
.append($('<td>' + meta['method'] + '</td>').click(clickHandler))
|
||||||
.append($('<td />').append(meta['uri'] + (meta['suffix'] ? ' ' + meta['suffix'] : '')))
|
.append($('<td />').append(meta['uri'] + (meta['suffix'] ? ' ' + meta['suffix'] : '')).click(clickHandler))
|
||||||
.css('cursor', 'pointer')
|
.css('cursor', 'pointer')
|
||||||
.on('click', function() {
|
|
||||||
widget.get('debugbar').showDataSet(meta['id']);
|
|
||||||
widget.$table.find('.' + csscls('active')).removeClass(csscls('active'));
|
|
||||||
tr.addClass(csscls('active'));
|
|
||||||
})
|
|
||||||
.addClass(csscls('table-row'))
|
.addClass(csscls('table-row'))
|
||||||
|
|
||||||
var debugbar = widget.get('debugbar');
|
var debugbar = widget.get('debugbar');
|
||||||
@@ -818,17 +826,14 @@ if (typeof(PhpDebugBar) == 'undefined') {
|
|||||||
key = key.split(':');
|
key = key.split(':');
|
||||||
if (key[1] === 'badge' && d > 0) {
|
if (key[1] === 'badge' && d > 0) {
|
||||||
var control = debugbar.getControl(key[0]);
|
var control = debugbar.getControl(key[0]);
|
||||||
var $a = $('<a>').attr('title', control.get('title'));
|
var $a = $('<a>').attr('title', control.get('title')).data('tab', key[0]);
|
||||||
if (control.$icon) {
|
if (control.$icon) {
|
||||||
$a.append(debugbar.getControl(key[0]).$icon.clone());
|
$a.append(debugbar.getControl(key[0]).$icon.clone());
|
||||||
}
|
}
|
||||||
if (control.$badge) {
|
if (control.$badge) {
|
||||||
$a.append(debugbar.getControl(key[0]).$badge.clone().css('display', 'inline-block').text(d));
|
$a.append(debugbar.getControl(key[0]).$badge.clone().css('display', 'inline-block').text(d));
|
||||||
}
|
}
|
||||||
$a.appendTo($badges);
|
$a.appendTo($badges).click(clickHandler);
|
||||||
$a.click(function() {
|
|
||||||
debugbar.showTab(key[0]);
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
Reference in New Issue
Block a user