mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-05 03:52:59 +00:00
Debug bar and configuration updates.
This commit is contained in:
@@ -0,0 +1,40 @@
|
||||
(function($) {
|
||||
|
||||
var csscls = PhpDebugBar.utils.makecsscls('phpdebugbar-widgets-');
|
||||
|
||||
/**
|
||||
* Widget for the displaying mails data
|
||||
*
|
||||
* Options:
|
||||
* - data
|
||||
*/
|
||||
var MailsWidget = PhpDebugBar.Widgets.MailsWidget = PhpDebugBar.Widget.extend({
|
||||
|
||||
className: csscls('mails'),
|
||||
|
||||
render: function() {
|
||||
this.$list = new PhpDebugBar.Widgets.ListWidget({ itemRenderer: function(li, mail) {
|
||||
$('<span />').addClass(csscls('subject')).text(mail.subject).appendTo(li);
|
||||
$('<span />').addClass(csscls('to')).text(mail.to).appendTo(li);
|
||||
if (mail.headers) {
|
||||
var headers = $('<pre />').addClass(csscls('headers')).appendTo(li);
|
||||
$('<code />').text(mail.headers).appendTo(headers);
|
||||
li.click(function() {
|
||||
if (headers.is(':visible')) {
|
||||
headers.hide();
|
||||
} else {
|
||||
headers.show();
|
||||
}
|
||||
});
|
||||
}
|
||||
}});
|
||||
this.$list.$el.appendTo(this.$el);
|
||||
|
||||
this.bindAttr('data', function(data) {
|
||||
this.$list.set('data', data);
|
||||
});
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
})(PhpDebugBar.$);
|
Reference in New Issue
Block a user