paper-tree icon indicating copy to clipboard operation
paper-tree copied to clipboard

Allow possibility to not display any icon

Open RHagendoorn opened this issue 8 years ago • 1 comments

If I understand correctly, it is currently not possible to not set an icon on the node. A workaround is to add icon 'none', however there is still a white space where the icon would normally be.

RHagendoorn avatar Dec 06 '17 14:12 RHagendoorn

I solved it by changing the code slightly. In paper-tree-node.html add this function

_isIconHidden(icon) {
    return icon == 'none';
}

then in the template bind the hidden attribute like so

...
<div class="node-row">
	<span class$="{{_computeClass(data.*)}}" on-click="toggleChildren"></span>
	<iron-icon class="node-icon" icon$="{{_computeIcon(data.icon)}}" 
			   hidden$="{{_isIconHidden(data.icon)}}"          <-- ***** here  *****
			   on-click="select"></iron-icon>
	<span class="node-name" on-click="select">{{data.name}}</span>                
</div>
...

nicolasr75 avatar Dec 20 '17 14:12 nicolasr75