Support custom SVG icon in Nested Content (#10368)

* Use custom SVG icon in Nested Content

* Get icon once

* Assign value instead of compare
This commit is contained in:
Bjarne Fyrstenborg
2021-06-07 02:40:14 +02:00
committed by GitHub
parent 57cc3d5da2
commit 340273a604

View File

@@ -6,9 +6,9 @@
<div class="umb-nested-content__items" ng-hide="vm.nodes.length === 0" ui-sortable="vm.sortableOptions" ng-model="vm.nodes">
<div ng-repeat="node in vm.nodes">
<div ng-repeat="node in vm.nodes" ng-init="node.icon = vm.getIcon($index)">
<ng-form name="ncRowForm" val-server-match="{ 'contains' : node.key }">
<ng-form name="ncRowForm" val-server-match="{ 'contains': node.key }">
<div class="umb-nested-content__item"
ng-class="{ 'umb-nested-content__item--active' : vm.currentNode.key === node.key, 'umb-nested-content__item--single' : vm.singleMode, '--error': ncRowForm.$invalid }">
@@ -18,7 +18,13 @@
ng-hide="vm.singleMode"
umb-auto-focus="{{vm.focusOnNode && vm.currentNode.key === node.key ? 'true' : 'false'}}">
<div class="umb-nested-content__heading"><i ng-if="vm.showIcons" class="icon umb-nested-content__item-icon" ng-class="vm.getIcon($index)"></i><span class="umb-nested-content__item-name" ng-class="{'--has-icon': vm.showIcons}" ng-bind="vm.getName($index)"></span></div>
<div class="umb-nested-content__heading">
<umb-icon
icon="{{node.icon}}"
class="{{node.icon}} icon umb-nested-content__item-icon">
</umb-icon>
<span class="umb-nested-content__item-name" ng-class="{'--has-icon': vm.showIcons}" ng-bind="vm.getName($index)"></span>
</div>
<div class="umb-nested-content__icons">
<button type="button" class="umb-nested-content__icon umb-nested-content__icon--copy" title="{{vm.labels.copy_icon_title}}" ng-click="vm.clickCopy($event, node);" ng-if="vm.showCopy">
@@ -34,7 +40,6 @@
</div>
</div>
<div class="umb-nested-content__content" ng-if="vm.currentNode.key === node.key && !vm.sorting">
<umb-nested-content-editor ng-model="node" tab-alias="ncTabAlias" />
</div>