]> git.wh0rd.org Git - tt-rss.git/blob - js/PrefLabelTree.js
body: disable overflow
[tt-rss.git] / js / PrefLabelTree.js
1 dojo.provide("fox.PrefLabelTree");
2
3 dojo.require("lib.CheckBoxTree");
4 dojo.require("dijit.form.DropDownButton");
5
6 dojo.declare("fox.PrefLabelTree", lib.CheckBoxTree, {
7         setNameById: function (id, name) {
8                 var item = this.model.store._itemsByIdentity['LABEL:' + id];
9
10                 if (item)
11                         this.model.store.setValue(item, 'name', name);
12
13         },
14         _createTreeNode: function(args) {
15                 var tnode = this.inherited(arguments);
16
17                 var fg_color = this.model.store.getValue(args.item, 'fg_color');
18                 var bg_color = this.model.store.getValue(args.item, 'bg_color');
19                 var type = this.model.store.getValue(args.item, 'type');
20                 var bare_id = this.model.store.getValue(args.item, 'bare_id');
21
22                 if (type == 'label') {
23                         var span = dojo.doc.createElement('span');
24                         span.innerHTML = 'α';
25                         span.className = 'labelColorIndicator';
26                         span.id = 'LICID-' + bare_id;
27
28                         span.setStyle({
29                                 color: fg_color,
30                                 backgroundColor: bg_color});
31
32                         tnode._labelIconNode = span;
33
34                         dojo.place(tnode._labelIconNode, tnode.labelNode, 'before');
35                 }
36
37                 return tnode;
38         },
39         getIconClass: function (item, opened) {
40                 return (!item || this.model.mayHaveChildren(item)) ? (opened ? "dijitFolderOpened" : "dijitFolderClosed") : "invisible";
41         },
42 });
43