Total Complexity | 7 |
Complexity/F | 1.4 |
Lines of Code | 40 |
Function Count | 5 |
Duplicated Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | (function($) { |
||
2 | |||
3 | var csscls = PhpDebugBar.utils.makecsscls('phpdebugbar-widgets-'); |
||
|
|||
4 | |||
5 | /** |
||
6 | * Widget for the displaying mails data |
||
7 | * |
||
8 | * Options: |
||
9 | * - data |
||
10 | */ |
||
11 | var MailsWidget = PhpDebugBar.Widgets.MailsWidget = PhpDebugBar.Widget.extend({ |
||
12 | |||
13 | className: csscls('mails'), |
||
14 | |||
15 | render: function() { |
||
16 | this.$list = new PhpDebugBar.Widgets.ListWidget({ itemRenderer: function(li, mail) { |
||
17 | $('<span />').addClass(csscls('subject')).text(mail.subject).appendTo(li); |
||
18 | $('<span />').addClass(csscls('to')).text(mail.to).appendTo(li); |
||
19 | if (mail.headers) { |
||
20 | var headers = $('<pre />').addClass(csscls('headers')).appendTo(li); |
||
21 | $('<code />').text(mail.headers).appendTo(headers); |
||
22 | li.click(function() { |
||
23 | if (headers.is(':visible')) { |
||
24 | headers.hide(); |
||
25 | } else { |
||
26 | headers.show(); |
||
27 | } |
||
28 | }); |
||
29 | } |
||
30 | }}); |
||
31 | this.$list.$el.appendTo(this.$el); |
||
32 | |||
33 | this.bindAttr('data', function(data) { |
||
34 | this.$list.set('data', data); |
||
35 | }); |
||
36 | } |
||
37 | |||
38 | }); |
||
39 | |||
40 | })(PhpDebugBar.$); |
||
41 |
This checks looks for references to variables that have not been declared. This is most likey a typographical error or a variable has been renamed.
To learn more about declaring variables in Javascript, see the MDN.