diff options
author | Heiko Adams <[email protected]> | 2016-08-19 17:25:05 +0200 |
---|---|---|
committer | Heiko Adams <[email protected]> | 2016-08-19 17:25:05 +0200 |
commit | 2842cf6e4563d1665741dd4c151798e6e282c60b (patch) | |
tree | 6aa8c94dd1d3ae81976dd154ee6ca46eb31908f1 /js/PrefLabelTree.js | |
parent | 94e3a9ab44d82e0d7052d5e2e40496230b5f21a4 (diff) | |
parent | c565a0cc21a6ee3e74ac9bc0cf4bfdde7cc84efd (diff) |
Merge branch 'master' into german-translation
Diffstat (limited to 'js/PrefLabelTree.js')
-rw-r--r-- | js/PrefLabelTree.js | 62 |
1 files changed, 31 insertions, 31 deletions
diff --git a/js/PrefLabelTree.js b/js/PrefLabelTree.js index 2f7dc0f53..673fd19ad 100644 --- a/js/PrefLabelTree.js +++ b/js/PrefLabelTree.js @@ -1,43 +1,43 @@ -dojo.provide("fox.PrefLabelTree"); +require(["dojo/_base/declare", "lib/CheckBoxTree", "dijit/form/DropDownButton"], function (declare) { -dojo.require("lib.CheckBoxTree"); -dojo.require("dijit.form.DropDownButton"); + return declare("fox.PrefLabelTree", lib.CheckBoxTree, { + setNameById: function (id, name) { + var item = this.model.store._itemsByIdentity['LABEL:' + id]; -dojo.declare("fox.PrefLabelTree", lib.CheckBoxTree, { - setNameById: function (id, name) { - var item = this.model.store._itemsByIdentity['LABEL:' + id]; + if (item) + this.model.store.setValue(item, 'name', name); - if (item) - this.model.store.setValue(item, 'name', name); + }, + _createTreeNode: function(args) { + var tnode = this.inherited(arguments); - }, - _createTreeNode: function(args) { - var tnode = this.inherited(arguments); + var fg_color = this.model.store.getValue(args.item, 'fg_color'); + var bg_color = this.model.store.getValue(args.item, 'bg_color'); + var type = this.model.store.getValue(args.item, 'type'); + var bare_id = this.model.store.getValue(args.item, 'bare_id'); - var fg_color = this.model.store.getValue(args.item, 'fg_color'); - var bg_color = this.model.store.getValue(args.item, 'bg_color'); - var type = this.model.store.getValue(args.item, 'type'); - var bare_id = this.model.store.getValue(args.item, 'bare_id'); + if (type == 'label') { + var span = dojo.doc.createElement('span'); + span.innerHTML = 'α'; + span.className = 'labelColorIndicator'; + span.id = 'LICID-' + bare_id; - if (type == 'label') { - var span = dojo.doc.createElement('span'); - span.innerHTML = 'α'; - span.className = 'labelColorIndicator'; - span.id = 'LICID-' + bare_id; + span.setStyle({ + color: fg_color, + backgroundColor: bg_color}); - span.setStyle({ - color: fg_color, - backgroundColor: bg_color}); + tnode._labelIconNode = span; - tnode._labelIconNode = span; + dojo.place(tnode._labelIconNode, tnode.labelNode, 'before'); + } - dojo.place(tnode._labelIconNode, tnode.labelNode, 'before'); - } + return tnode; + }, + getIconClass: function (item, opened) { + return (!item || this.model.mayHaveChildren(item)) ? (opened ? "dijitFolderOpened" : "dijitFolderClosed") : "invisible"; + }, + }); - return tnode; - }, - getIconClass: function (item, opened) { - return (!item || this.model.mayHaveChildren(item)) ? (opened ? "dijitFolderOpened" : "dijitFolderClosed") : "invisible"; - }, }); + |