1 dojo.provide("fox.PrefLabelTree");
3 dojo.require("lib.CheckBoxTree");
4 dojo.require("dijit.form.DropDownButton");
6 dojo.declare("fox.PrefLabelTree", lib.CheckBoxTree, {
7 setNameById: function (id, name) {
8 var item = this.model.store._itemsByIdentity['LABEL:' + id];
11 this.model.store.setValue(item, 'name', name);
14 _createTreeNode: function(args) {
15 var tnode = this.inherited(arguments);
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');
22 if (type == 'label') {
23 var span = dojo.doc.createElement('span');
24 span.innerHTML = 'α';
25 span.className = 'labelColorIndicator';
26 span.id = 'LICID-' + bare_id;
30 backgroundColor: bg_color});
32 tnode._labelIconNode = span;
34 dojo.place(tnode._labelIconNode, tnode.labelNode, 'before');
39 getIconClass: function (item, opened) {
40 return (!item || this.model.mayHaveChildren(item)) ? (opened ? "dijitFolderOpened" : "dijitFolderClosed") : "invisible";