]>
git.wh0rd.org - tt-rss.git/blob - js/PrefLabelTree.js
2 define(["dojo/_base/declare", "dojo/dom-construct", "lib/CheckBoxTree", "dijit/form/DropDownButton"], function (declare
, domConstruct
) {
4 return declare("fox.PrefLabelTree", lib
.CheckBoxTree
, {
5 setNameById: function (id
, name
) {
6 const item
= this.model
.store
._itemsByIdentity
['LABEL:' + id
];
9 this.model
.store
.setValue(item
, 'name', name
);
12 _createTreeNode: function(args
) {
13 const tnode
= this.inherited(arguments
);
15 const fg_color
= this.model
.store
.getValue(args
.item
, 'fg_color');
16 const bg_color
= this.model
.store
.getValue(args
.item
, 'bg_color');
17 const type
= this.model
.store
.getValue(args
.item
, 'type');
18 const bare_id
= this.model
.store
.getValue(args
.item
, 'bare_id');
20 if (type
== 'label') {
21 const span
= dojo
.doc
.createElement('span');
22 span
.innerHTML
= 'α';
23 span
.className
= 'labelColorIndicator';
24 span
.id
= 'LICID-' + bare_id
;
28 backgroundColor
: bg_color
});
30 tnode
._labelIconNode
= span
;
32 domConstruct
.place(tnode
._labelIconNode
, tnode
.labelNode
, 'before');
37 getIconClass: function (item
, opened
) {
38 return (!item
|| this.model
.mayHaveChildren(item
)) ? (opened
? "dijitFolderOpened" : "dijitFolderClosed") : "invisible";