<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
true
false
if you want to open a modal later in the code or have more than one method of opening a modal. true
renderFooter
or renderBody
is required when creating a modal. undefined
renderFooter
or renderBody
is required when creating a modal. undefined
true
false
if you want to open a modal later in the code or have more than one method of opening a modal. true
hide
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. undefined
renderFooter
or renderBody
is required when creating a modal. undefined
renderFooter
or renderBody
is required when creating a modal. undefined
true
false
if you want to open a modal later in the code or have more than one method of opening a modal. true
hide
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. undefined
renderFooter
or renderBody
is required when creating a modal. undefined
renderFooter
or renderBody
is required when creating a modal. undefined