diff --git a/widgets/vis-homekittiles.html b/widgets/vis-homekittiles.html index 85ff3de..2177cad 100644 --- a/widgets/vis-homekittiles.html +++ b/widgets/vis-homekittiles.html @@ -379,7 +379,7 @@ ' - data-vis-attrs="description/custom,vis-homekittiles.infoText,hktSwitchBool;oid/id;icon/image;iconRound/checkbox;iconColored/checkbox;displaystyle[tile]/select,tile,tile big,tile small,indicator,tile iconOnly,tile textonly;" + data-vis-attrs="description/custom,vis-homekittiles.infoText,hktSwitchBool;oid/id;icon/image;iconRound/checkbox;iconColored/checkbox;displaystyle[tile]/select,tile,tile big,tile small,indicator,tile iconOnly,tile textonly/iconShowHideInputfields();" data-vis-attrs0="group.labelGroup1;label[Switch];label2pre;label2oid/id;label2unit;label2post;label2decimals[1];label2factor[1];label2comma[true]/checkbox;label2tdp/checkbox;" data-vis-attrs1="group.labelGroup2;label3pre;label3oid/id;label3unit;label3post;label3decimals[1];label3factor[1];label3comma[true]/checkbox;label3tdp/checkbox;label4pre;label4oid/id;label4unit;label4post;label4decimals[1];label4factor[1];label4comma[true]/checkbox;label4tdp/checkbox;label5pre;label5oid/id;label5unit;label5post;label5decimals[1];label5factor[1];label5comma[true]/checkbox;label5tdp/checkbox;" data-vis-attrs2="group.increment;oidIncrement/id;incrementPlusShow/checkbox;incrementMinusShow/checkbox;incrementPlusValue[1];incrementMinusValue[-1];incrementValueMax[100];incrementValueMin[0];incrementShowOnlyIfTrue/checkbox;" @@ -452,7 +452,7 @@ ' - data-vis-attrs="description/custom,vis-homekittiles.infoText,hktViewInWidgetDialog;oidActive/id;icon/image;iconRound/checkbox;iconColored/checkbox;showLikeActive/checkbox;displaystyle[tile]/select,tile,tile big,tile small,indicator,tile iconOnly,tile textonly;" + data-vis-attrs="description/custom,vis-homekittiles.infoText,hktViewInWidgetDialog;oidActive/id;icon/image;iconRound/checkbox;iconColored/checkbox;showLikeActive/checkbox;displaystyle[tile]/select,tile,tile big,tile small,indicator,tile iconOnly,tile textonly/iconShowHideInputfields();" data-vis-attrs0="group.labelGroup1;label[Dialog];label2pre;label2oid/id;label2unit;label2post;label2decimals[1];label2factor[1];label2comma[true]/checkbox;label2tdp/checkbox;" data-vis-attrs1="group.labelGroup2;label3pre;label3oid/id;label3unit;label3post;label3decimals[1];label3factor[1];label3comma[true]/checkbox;label3tdp/checkbox;label4pre;label4oid/id;label4unit;label4post;label4decimals[1];label4factor[1];label4comma[true]/checkbox;label4tdp/checkbox;label5pre;label5oid/id;label5unit;label5post;label5decimals[1];label5factor[1];label5comma[true]/checkbox;label5tdp/checkbox;" data-vis-attrs2="group.increment;oidIncrement/id;incrementPlusShow/checkbox;incrementMinusShow/checkbox;incrementPlusValue[1];incrementMinusValue[-1];incrementValueMax[100];incrementValueMin[0];incrementShowOnlyIfTrue/checkbox;" diff --git a/widgets/vis-homekittiles/css/style.css b/widgets/vis-homekittiles/css/style.css index 8476695..3e210d0 100644 --- a/widgets/vis-homekittiles/css/style.css +++ b/widgets/vis-homekittiles/css/style.css @@ -525,6 +525,14 @@ .homekitTiles.tile.textonly .increment { display: none } +.homekitTiles.tile.textonly .ackIcon { + width: 20px; + height: 20px; + top: 50%; + right: 0px; + position: absolute; + transform: translate(100%,-50%); +} /*#endregion*/ /*----------------------------------------------------------------*/ /*#region Date-Picker */ diff --git a/widgets/vis-homekittiles/js/vis-homekittiles.js b/widgets/vis-homekittiles/js/vis-homekittiles.js index 3ce57de..807dfa7 100644 --- a/widgets/vis-homekittiles/js/vis-homekittiles.js +++ b/widgets/vis-homekittiles/js/vis-homekittiles.js @@ -331,6 +331,27 @@ vis.binds["vis-homekittiles"] = { return {input: `${_(text)}`}; }, + //Remove input fields for icons if displaystyle is textonly and add if not + //Used at SwitchBool and ViewInWidgetDialog + iconShowHideInputfields: function (widgetID, view, newId, attr, isCss) { + + vis.activeWidgets.forEach(function (el) { + let data = vis.views[vis.activeView].widgets[el].data; + let val = data.displaystyle; + + if (val == 'tile textonly') { + vis.hideShowAttr('icon', false); + vis.hideShowAttr('iconRound', false); + vis.hideShowAttr('iconColored', false); + } else { + vis.hideShowAttr('icon', true); + vis.hideShowAttr('iconRound', true); + vis.hideShowAttr('iconColored', true); + } + + }); + }, + //Radiobuttons - copied from jqui to don't force jqui button styles radio: function (el, options, process) { var $this = $(el);