rename gallery.js to dialog.js, keep close string in meta.js
This commit is contained in:
parent
37cdc1915b
commit
a063d227d3
3 changed files with 7 additions and 2 deletions
|
|
@ -58,6 +58,9 @@ export const details = {
|
|||
expand: 'expand all',
|
||||
collapse: 'collapse all'
|
||||
};
|
||||
export const dialog = {
|
||||
close: 'Close'
|
||||
};
|
||||
export const navigation = {
|
||||
navLabel: 'Menu',
|
||||
ariaTop: 'Main',
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
<div class="gallery | grid mt-l-xl" role="list">
|
||||
{%- for item in gallery -%}
|
||||
<dialog class="flow modal{{ loop.index }}">
|
||||
<button class="button" autofocus>Close</button>
|
||||
<button class="button" autofocus>{{ meta.dialog.close }}</button>
|
||||
{%- image item.image, item.alt, item.caption -%}
|
||||
</dialog>
|
||||
<button data-index="{{ loop.index }}">{%- image item.image, item.alt -%}</button>
|
||||
|
|
@ -14,6 +14,6 @@
|
|||
{% endcss %}
|
||||
|
||||
{% js "defer" %}
|
||||
{% include "scripts/gallery.js" %}
|
||||
{% include "scripts/dialog.js" %}
|
||||
{% endjs %}
|
||||
</is-land>
|
||||
|
|
|
|||
|
|
@ -1,3 +1,5 @@
|
|||
// manages the behavior of modal several dialogs on a page: open / close buttons and light dismiss.
|
||||
|
||||
const buttons = document.querySelectorAll('button[data-index]');
|
||||
const modals = document.querySelectorAll('dialog');
|
||||
const closeButtons = document.querySelectorAll('dialog button');
|
||||
Loading…
Reference in a new issue