Skip to content

Commit

Permalink
Checks for specific data before rendering
Browse files Browse the repository at this point in the history
  • Loading branch information
RobertPeek committed Sep 13, 2022
1 parent ad84234 commit a0a401d
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 19 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ The Icon popup attribute group contains values for **_isEnabled**, **_classes**,
No known limitations.

----------------------------
**Version number:** 4.4.1
**Version number:** 4.4.2
**Framework versions supported:** 5.8+
**Author / maintainer:** DeltaNet with [contributors](https://github.com/deltanet/adapt-icon-popup/graphs/contributors)
**Accessibility support:** Yes
Expand Down
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "adapt-icon-popup",
"version": "4.4.1",
"version": "4.4.2",
"framework": ">=5.8",
"homepage": "https://github.com/deltanet/adapt-icon-popup",
"issues": "https://github.com/deltanet/adapt-icon-popup/issues",
Expand Down
40 changes: 23 additions & 17 deletions templates/iconpopup.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,32 @@
<div class="iconpopup__items">
{{#each _iconPopup._items}}
<div class="iconpopup__item item-{{@index}}">

{{#if _buttonGraphic._isEnabled}}
<button class="iconpopup__btn is-image{{#if _buttonGraphic.srcHover}} iconpopup-button-states-image{{/if}} js-iconpopup-btn-click" aria-label="{{_ariaLabels.openPopup}}">
<img src="{{_buttonGraphic.src}}" class="iconpopup-button-image-default"/>
<img src="{{_buttonGraphic.srcHover}}" class="iconpopup-button-image-hover"/>
<img src="{{_buttonGraphic.srcVisited}}" class="iconpopup-button-image-visited"/>
</button>

{{#if _buttonGraphic._isEnabled}}
<button class="iconpopup__btn is-image{{#any _buttonGraphic.srcHover _buttonGraphic.srcVisited}} iconpopup-button-states-image{{/any}} js-iconpopup-btn-click" aria-label="{{_ariaLabels.openPopup}}">
<img src="{{_buttonGraphic.src}}" class="iconpopup-button-image-default"/>
{{#if _buttonGraphic.srcHover}}
<img src="{{_buttonGraphic.srcHover}}" class="iconpopup-button-image-hover"/>
{{/if}}
{{#if _buttonGraphic.srcVisited}}
<img src="{{_buttonGraphic.srcVisited}}" class="iconpopup-button-image-visited"/>
{{/if}}
</button>
{{/if}}

<button class="iconpopup__btn js-iconpopup-btn-click" aria-label="{{_ariaLabels.openPopup}}">
{{#any _buttonIcon._iconSelection _buttonIcon._icon}}
<div class="icon {{#if _buttonIcon._iconSelection}}{{_buttonIcon._iconSelection}}{{else if _buttonIcon._icon}}{{_buttonIcon._icon}}{{/if}}"></div>
{{/any}}
{{#any _buttonIcon._iconSelection _buttonIcon._icon _buttonTitle}}
<button class="iconpopup__btn js-iconpopup-btn-click" aria-label="{{_ariaLabels.openPopup}}">
{{#any _buttonIcon._iconSelection _buttonIcon._icon}}
<div class="icon {{#if _buttonIcon._iconSelection}}{{_buttonIcon._iconSelection}}{{else if _buttonIcon._icon}}{{_buttonIcon._icon}}{{/if}}"></div>
{{/any}}

{{#if _buttonTitle}}
<div class="iconpopup__btn-text{{#any _buttonIcon._iconSelection _buttonIcon._icon}} is-icon{{/any}}">
{{_buttonTitle}}
</div>
{{/if}}
</button>
{{#if _buttonTitle}}
<div class="iconpopup__btn-text{{#any _buttonIcon._iconSelection _buttonIcon._icon}} is-icon{{/any}}">
{{_buttonTitle}}
</div>
{{/if}}
</button>
{{/any}}

</div>
{{/each}}
Expand Down

0 comments on commit a0a401d

Please sign in to comment.