Skip to content

Commit c2342d1

Browse files
committed
Use classes for modal too
1 parent c0f0a56 commit c2342d1

File tree

4 files changed

+63
-7
lines changed

4 files changed

+63
-7
lines changed

assets/js/handlebars/templates/modal-layout.handlebars

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<div id="modal" class="modal" tabindex="-1">
1+
<div class="modal" tabindex="-1">
22
<div class="modal-contents">
33
<div class="modal-header">
44
<div class="modal-title"></div>

assets/js/modal.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import { qs } from './helpers'
22

3-
const MODAL_SELECTOR = '#modal'
4-
const MODAL_CLOSE_BUTTON_SELECTOR = '#modal .modal-close'
5-
const MODAL_TITLE_SELECTOR = '#modal .modal-title'
6-
const MODAL_BODY_SELECTOR = '#modal .modal-body'
3+
const MODAL_SELECTOR = '.modal'
4+
const MODAL_CLOSE_BUTTON_SELECTOR = '.modal .modal-close'
5+
const MODAL_TITLE_SELECTOR = '.modal .modal-title'
6+
const MODAL_BODY_SELECTOR = '.modal .modal-body'
77
const FOCUSABLE_SELECTOR = 'button:not([disabled]), [href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])'
88
const state = {
99
prevFocus: null,
@@ -38,7 +38,7 @@ function renderModal () {
3838
qs(MODAL_SELECTOR).addEventListener('click', event => {
3939
const classList = event.target.classList
4040
// if we clicked on the modal overlay/parent but not the modal content
41-
if (classList.contains('modal') && classList.contains('shown') && classList.length === 2) {
41+
if (classList.contains('modal')) {
4242
closeModal()
4343
}
4444
})

formatters/html/dist/handlebars.templates-2MV2EWES.js renamed to formatters/html/dist/handlebars.templates-K7URE6B4.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

formatters/html/dist/html-BHYOTRCH.js

Lines changed: 56 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)