<button id="modal-center" class="hx-btn hx-flag-button">Show Center Modal</button>hx.select('#modal-center').on('click', () => {
hx.modalCenter({
title: 'Modal Title',
renderBody: () => hx.div().text('Modal Body'),
renderFooter: thisModal => hx.button('hx-btn hx-secondary')
.on('click', () => thisModal.hide())
.text('Ok'),
});
})<button id="modal-right" class="hx-btn hx-flag-button">Show Right Modal</button>hx.select('#modal-right').on('click', () => {
hx.modalRight({
title: 'Modal Title',
renderBody: () => hx.div().text('Modal Body'),
renderFooter: thisModal => hx.button('hx-btn hx-secondary')
.on('click', () => thisModal.hide())
.text('Ok'),
});
})<button id="modal-full-screen" class="hx-btn hx-flag-button">Show Full Screen Modal</button>hx.select('#modal-full-screen').on('click', () => {
hx.modalFullScreen({
title: 'Modal Title',
renderBody: () => hx.div().text('Modal Body'),
renderFooter: thisModal => hx.button('hx-btn hx-secondary')
.on('click', () => thisModal.hide())
.text('Ok'),
});
})modalCenter, modalRight and modalFullScreen function (node, titleNode, closeButtonNode) {
hx.select(node).add(titleNode).add(closeButtonNode)
}function (node) {
hx.select(node).text(this.title)
}modalCenter modalRight modalFullScreen hide immediately. Providing options.onClose will override this and call the provided method instead, allowing the close action to be intercepted without closing the modal. isOpen(false) renderBody and renderFooter options. isOpen(true) hx object. [
{
text: "Confirm"
icon: "fa fa-check"
value: true
classes: "hx-btn hx-positive"
},{
text: "Cancel"
icon: "fa fa-close"
value: false
classes: "hx-btn hx-negative"
}
]modalCenter [
{
text: "Confirm"
icon: "fa fa-check"
value: true
classes: "hx-btn hx-positive"
},{
text: "Cancel"
icon: "fa fa-close"
value: false
classes: "hx-btn hx-negative"
}
]modalCenter truefalse if you want to open a modal later in the code or have more than one method of opening a modal. truerenderFooter or renderBody is required when creating a modal. undefinedrenderFooter or renderBody is required when creating a modal. undefinedtruefalse if you want to open a modal later in the code or have more than one method of opening a modal. truehide method. If this options is provided, it will be used instead and the modal will not be hidden. hide or allows the user to continue editing the information. undefinedrenderFooter or renderBody is required when creating a modal. undefinedrenderFooter or renderBody is required when creating a modal. undefinedtruefalse if you want to open a modal later in the code or have more than one method of opening a modal. truehide method. If this options is provided, it will be used instead and the modal will not be hidden. hide or allows the user to continue editing the information. undefinedrenderFooter or renderBody is required when creating a modal. undefinedrenderFooter or renderBody is required when creating a modal. undefined