Skip to content

Commit

Permalink
Do not request icon with state for Image Items (openhab#2638)
Browse files Browse the repository at this point in the history
Fixes openhab#2561.
Fixes openhab#2637.

Signed-off-by: Florian Hotze <[email protected]>
  • Loading branch information
florian-h05 authored Jul 1, 2024
1 parent 2d935d6 commit 57749b4
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
<f7-list-input ref="category" label="Category" autocomplete="off" type="text" placeholder="temperature, firstfloor..." :value="itemCategory"
@input="itemCategory = $event.target.value" :disabled="!editable" :clear-button="editable">
<div slot="root-end" style="margin-left: calc(35% + 14px)">
<oh-icon :icon="itemCategory" :state="(createMode) ? null : item.state" height="32" width="32" />
<oh-icon :icon="itemCategory" :state="(createMode || itemType === 'Image') ? null : item.state" height="32" width="32" />
</div>
</f7-list-input>
</f7-list-group>
Expand Down
2 changes: 1 addition & 1 deletion bundles/org.openhab.ui/web/src/components/item/item.vue
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
:subtitle="noType ? '' : getItemTypeAndMetaLabel(item)"
:after="state"
v-on="$listeners">
<oh-icon v-if="!noIcon && item.category" slot="media" :icon="item.category" :state="(noState) ? null : (context && context.store) ? context.store[item.name].state : item.state" height="32" width="32" />
<oh-icon v-if="!noIcon && item.category" slot="media" :icon="item.category" :state="(noState || item.type === 'Image') ? null : (context.store[item.name].state || item.state)" height="32" width="32" />
<span v-else-if="!noIcon" slot="media" class="item-initial">{{ item.name[0] }}</span>
<f7-icon v-if="!item.editable" slot="after-title" f7="lock_fill" size="1rem" color="gray" />
<slot name="footer" #footer />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
:footer="(link.item.label) ? link.item.name : '\xa0'"
:subtitle="getItemTypeAndMetaLabel(link.item)"
:after="context.store[link.item.name] ? context.store[link.item.name].displayState || context.store[link.item.name].state : link.item.state">
<oh-icon v-if="link.item.category" slot="media" :icon="link.item.category" :state="context.store[link.item.name] ? context.store[link.item.name].state : link.item.state" height="32" width="32" />
<oh-icon v-if="link.item.category" slot="media" :icon="link.item.category" :state="link.item.type === 'Image' ? null : (context.store[link.item.name].state || link.item.state)" height="32" width="32" />
<span v-else slot="media" class="item-initial">{{ link.item.name[0] }}</span>
<f7-icon v-if="!link.item.editable" slot="after-title" f7="lock_fill" size="1rem" color="gray" />
<!-- <f7-button slot="after-start" color="blue" icon-f7="compose" icon-size="24px" :link="`${item.name}/edit`"></f7-button> -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
</f7-nav-right>
<f7-subnavbar sliding class="item-header">
<div class="item-icon" v-if="item.name">
<oh-icon v-if="item.category" :icon="item.category" :state="context.store[item.name] ? context.store[item.name].state : item.state" height="60" width="60" />
<oh-icon v-if="item.category" :icon="item.category" :state="item.type === 'Image' ? null : (context.store[item.name].state || item.state)" height="60" width="60" />
<span v-else>
{{ item.label ? item.label[0] : item.name[0] }}
</span>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@
:style="`top: ${vlData.topPosition}px`"
:after="(item.state) ? item.state : '\xa0'">
<!-- Note: Using dynamic states is not possible since state tracking has a heavy performance impact -->
<oh-icon v-if="item.category" slot="media" :icon="item.category" :state="(item.state) ? item.state : null" height="32" width="32" />
<oh-icon v-if="item.category" slot="media" :icon="item.category" :state="item.type === 'Image' ? null : item.state" height="32" width="32" />
<span v-else slot="media" class="item-initial">{{ item.name[0] }}</span>
<f7-icon v-if="!item.editable" slot="after-title" f7="lock_fill" size="1rem" color="gray" />
<!-- <f7-button slot="after-start" color="blue" icon-f7="compose" icon-size="24px" :link="`${item.name}/edit`"></f7-button> -->
Expand Down

0 comments on commit 57749b4

Please sign in to comment.