open-law/src/books.ts

27 lines
686 B
TypeScript
Raw Normal View History

2023-04-21 09:32:25 +00:00
import {Modal} from 'flowbite';
import type {ModalOptions, ModalInterface} from 'flowbite';
// // For your js code
const $addUserModalElement: HTMLElement =
document.querySelector('#add-book-modal');
const modalOptions: ModalOptions = {
placement: 'bottom-right',
closable: true,
2023-05-15 09:14:49 +00:00
onHide: () => {},
onShow: () => {},
onToggle: () => {},
2023-04-21 09:32:25 +00:00
};
const addModal: ModalInterface = new Modal($addUserModalElement, modalOptions);
export function initBooks() {
// closing add book modal
const addModalCloseBtn = document.querySelector('#modalAddCloseButton');
if (addModalCloseBtn) {
addModalCloseBtn.addEventListener('click', () => {
addModal.hide();
});
}
}