LT-275: Creating selected state with 'rename' and 'add description' options

This commit is contained in:
Bruno Alves de Faria committed 2016-08-15 15:04:55 -03:00
1 parent 62f102617f
commit c437081b90
6 files changed
+119 -9

No files matched your search

@@ -27,6 +27,7 @@
id=(concat this.storageKey '_' (encodeId item.value))
class=this.radioClass
name=this.key
itemData=item
value=item.value
label=item.label
labelClass=(valueIf (isArray item.items) 'tree-node' 'tree-leaf')
@@ -140,8 +140,8 @@ Template.selectTree.events({
const rootComponent = instance.data.root || component;
const rootInstance = rootComponent.templateInstance;
// Change the component's value
component.value(eventComponent.value());
// Change the component's node
component.node(eventComponent.value());
// Unset the active leaf
rootInstance.$('label').removeClass('active').css('width', '');
@@ -169,6 +169,10 @@ Template.selectTree.events({
storedData[itemKey] = 1;
}
// Set the selected leaf value in the root component
const itemData = $target.data('component').templateInstance.data.itemData;
rootComponent.value(itemData);
// Updata the stored data with the new count
OHIF.user.setData(storageKey, storedData);
}