mirror of
https://github.com/maximebf/php-debugbar.git
synced 2025-07-25 18:51:42 +02:00
Link indicator to tab
This commit is contained in:
@@ -321,6 +321,13 @@ if (typeof(PhpDebugBar) == 'undefined') {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
var self = this;
|
||||||
|
this.bindAttr('link', function(link) {
|
||||||
|
this.$el.css('cursor', 'pointer').click(function() {
|
||||||
|
self.get('debugbar').showTab(link);
|
||||||
|
})
|
||||||
|
});
|
||||||
|
|
||||||
this.bindAttr(['title', 'data'], $('<span />').addClass(csscls('text')).appendTo(this.$el));
|
this.bindAttr(['title', 'data'], $('<span />').addClass(csscls('text')).appendTo(this.$el));
|
||||||
|
|
||||||
this.$tooltip = $('<span />').addClass(csscls('tooltip disabled')).appendTo(this.$el);
|
this.$tooltip = $('<span />').addClass(csscls('tooltip disabled')).appendTo(this.$el);
|
||||||
@@ -865,10 +872,11 @@ if (typeof(PhpDebugBar) == 'undefined') {
|
|||||||
* @param {String} position "right" or "left", default is "right"
|
* @param {String} position "right" or "left", default is "right"
|
||||||
* @return {Indicator}
|
* @return {Indicator}
|
||||||
*/
|
*/
|
||||||
createIndicator: function(name, icon, tooltip, position) {
|
createIndicator: function(name, icon, tooltip, position, link) {
|
||||||
var indicator = new Indicator({
|
var indicator = new Indicator({
|
||||||
icon: icon,
|
icon: icon,
|
||||||
tooltip: tooltip
|
tooltip: tooltip,
|
||||||
|
link: link
|
||||||
});
|
});
|
||||||
return this.addIndicator(name, indicator, position);
|
return this.addIndicator(name, indicator, position);
|
||||||
},
|
},
|
||||||
@@ -886,6 +894,8 @@ if (typeof(PhpDebugBar) == 'undefined') {
|
|||||||
throw new Error(name + ' already exists');
|
throw new Error(name + ' already exists');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
indicator.set('debugbar', this);
|
||||||
|
|
||||||
if (position == 'left') {
|
if (position == 'left') {
|
||||||
indicator.$el.insertBefore(this.$headerLeft.children().first());
|
indicator.$el.insertBefore(this.$headerLeft.children().first());
|
||||||
} else {
|
} else {
|
||||||
|
Reference in New Issue
Block a user