A Bootstrap Modal Helper written in TypeScript.
The constructor accepts 4 arguments
id: string
- This will be the unique identifier for the generated outermost
<div>
element.
- This will be the unique identifier for the generated outermost
$target: JQuery
- The target JQuery element, into which the modal markup will be injected. The wrapper around the modal.
settings: IBsModalHelperSettings
- The settings object.
config?: IBsModalHelperConfig
- (Optional) The config object.
The helper can be initialized like so:
var myModalSettings: Kaiser.IBsModalHelperSettings = {
title: "Title",
body: "Body"
};
var myModal = new Kaiser.BsModalHelper("myModal", $("#myModalWrapper"), myModalSettings);
To show the modal, simply use the show()
and hide()
methods:
myModal.show();
myModal.hide();
A sample config object:
var myModalConfig: Kaiser.IBsModalHelperConfig = {
showFooter: false,
modalOptions: { backdrop: "static", keyboard: false, show: false }
};