From fe05596b6fb8958f4ed162d62e53e4dea373cfff Mon Sep 17 00:00:00 2001 From: Robert von Burg Date: Thu, 19 Aug 2021 10:53:07 +0200 Subject: [PATCH] [Fix] Updated to strolch-wc-tree 0.2.0 --- bower.json | 4 ++-- strolch-wc-control.html | 16 +++++++++------- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/bower.json b/bower.json index f4f8e62..880b85b 100644 --- a/bower.json +++ b/bower.json @@ -1,7 +1,7 @@ { "name": "strolch-wc-inspector", "description": "Strolch WebComponent Inspector", - "version": "0.22.1", + "version": "0.22.2", "authors": ["Robert von Burg"], "keywords": [ "strolch", @@ -20,7 +20,7 @@ "strolchjs": "strolch-li/strolchjs#^0.4.3", "strolch-wc-styles": "strolch-li/strolch-wc-styles#^0.3.1", "strolch-wc-debounced-input": "strolch-li/strolch-wc-debounced-input#^0.1.1", - "strolch-wc-tree": "strolch-li/strolch-wc-tree#^0.1.10", + "strolch-wc-tree": "strolch-li/strolch-wc-tree#^0.2.0", "strolch-wc-ws-observer": "strolch-li/strolch-wc-ws-observer#^0.2.7", "polymer": "Polymer/polymer#^1.11.3", diff --git a/strolch-wc-control.html b/strolch-wc-control.html index 40d204c..021654c 100644 --- a/strolch-wc-control.html +++ b/strolch-wc-control.html @@ -664,7 +664,7 @@ /* Private */ _getIcon: function (item) { - if (item == null || item.state == null || item.state == '') return ''; + if (item == null || item.state == null || item.state === '') return ''; return this.resolveUrl('icons/' + item.state + '.png'); }, @@ -672,21 +672,23 @@ /* Lifecycle */ ready: function () { - var that = this; this.funcObj = { getTitle: function (item) { return item == null ? "" : "" + item.type + ": " + item.name; + }.bind(this), + useIcon: function (item) { + return item != null && item.state != null && item.state !== ''; }, getIcon: function (item) { - if (item == null || item.state == null || item.state == '') return ''; - return that.resolveUrl('icons/' + item.state + '.png'); - }, + if (item == null || item.state == null || item.state === '') return ''; + return this.resolveUrl('icons/' + item.state + '.png'); + }.bind(this), hasElements: function (item) { return item != null && item.elements && item.elements.length > 0; - }, + }.bind(this), getElements: function (item) { return item == null ? [] : (item.elements ? item.elements : []); - } + }.bind(this) }; }, reload: function () {