chore(dialogs): remove excessive duplicate markup for fallback modal hack
This commit is contained in:
parent
33c00fa74b
commit
3d866262ca
12 changed files with 58 additions and 106 deletions
17
src/includes/blocks/dialog.liquid
Normal file
17
src/includes/blocks/dialog.liquid
Normal file
|
@ -0,0 +1,17 @@
|
|||
{%- capture labelContent -%}
|
||||
{%- if icon -%}
|
||||
{% tablericon icon %}
|
||||
{%- elsif label -%}
|
||||
{{ label }}
|
||||
{%- endif -%}
|
||||
{%- endcapture -%}
|
||||
{% assign dialogId = id | default:"dialog-controls" %}
|
||||
<button class="dialog-open client-side" data-dialog-trigger="{{ dialogId }}" data-dialog-button>
|
||||
{{ labelContent }}
|
||||
</button>
|
||||
<dialog id="dialog-{{ dialogId }}" class="client-side">
|
||||
<button class="dialog-close" data-dialog-button>
|
||||
{% tablericon "circle-x" %}
|
||||
</button>
|
||||
{{ content }}
|
||||
</dialog>
|
|
@ -1,29 +0,0 @@
|
|||
{%- capture labelContent -%}
|
||||
{%- if icon -%}
|
||||
{% tablericon icon %}
|
||||
{%- elsif label -%}
|
||||
{{ label }}
|
||||
{%- endif -%}
|
||||
{%- endcapture -%}
|
||||
{% assign modalId = id | default:"modal-controls" %}
|
||||
<noscript>
|
||||
<input class="modal-input" id="{{ modalId }}" type="checkbox" tabindex="0" />
|
||||
<label class="modal-open" for="{{ modalId }}">{{ labelContent }}</label>
|
||||
<div class="modal-wrapper">
|
||||
<div class="modal-body">
|
||||
<label class="modal-close" for="{{ modalId }}">
|
||||
{% tablericon "circle-x" %}
|
||||
</label>
|
||||
{{ content }}
|
||||
</div>
|
||||
</div>
|
||||
</noscript>
|
||||
<button class="modal-open client-side" data-modal-trigger="{{ modalId }}" data-modal-button>
|
||||
{{ labelContent }}
|
||||
</button>
|
||||
<dialog id="dialog-{{ modalId }}" class="client-side">
|
||||
<button class="modal-close" data-modal-button>
|
||||
{% tablericon "circle-x" %}
|
||||
</button>
|
||||
{{ content }}
|
||||
</dialog>
|
|
@ -13,14 +13,16 @@
|
|||
{{ item.content_date | date:"%B %e, %Y" }}
|
||||
</time>
|
||||
• {{ item.label }}
|
||||
{%- if item.notes -%}
|
||||
{% assign notes = item.notes | prepend: "### Notes\n" | markdown %}
|
||||
• {% render "blocks/modal.liquid",
|
||||
label:"Notes",
|
||||
content:notes,
|
||||
id:item.content_date
|
||||
%}
|
||||
{%- endif -%}
|
||||
<span class="client-side">
|
||||
{%- if item.notes -%}
|
||||
{% assign notes = item.notes | prepend: "### Notes\n" | markdown %}
|
||||
• {% render "blocks/dialog.liquid",
|
||||
label:"Notes",
|
||||
content:notes,
|
||||
id:item.content_date
|
||||
%}
|
||||
{%- endif -%}
|
||||
</span>
|
||||
</aside>
|
||||
<h3>
|
||||
{%- if item.type == "concerts" -%}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue