Constructor
new ModalViewController()
- Source:
ModalViewController Constructor
You can customize modal behaviour via this.MaskConfig
and this.AnimationConfig
.
See the code if needed.
Example
const modalViewController = new Craft.UI.ModalViewController();
modalViewController.loadView();
const dialog = new Dialog({
closeHandler : () => {
modalViewController.hideContent( () => {
dialog.unloadView();
modalViewController.unloadView();
});
}
});
dialog.loadView();
modalViewController.setContent(dialog);
Craft.Core.Context.getRootViewController().appendView(modalViewController);
modalViewController.showContent();
Classes
Methods
viewDidLoad(callback)
- Source:
override viewDidLoad:
Parameters:
Name | Type | Description |
---|---|---|
callback |
function | callback |
setContent(component)
- Source:
Set modal content
Parameters:
Name | Type | Description |
---|---|---|
component |
Craft.Core.Component | component |
showMask(callback)
- Source:
Show mask
Parameters:
Name | Type | Description |
---|---|---|
callback |
function | callback |
hideMask(callback)
- Source:
Hide mask
Parameters:
Name | Type | Description |
---|---|---|
callback |
function | callback |
showContent(callback)
- Source:
Show modal content
Parameters:
Name | Type | Description |
---|---|---|
callback |
function | callback |
hideContent(callback)
- Source:
Hide modal content
Parameters:
Name | Type | Description |
---|---|---|
callback |
function | callback |
(protected) style()
- Source:
style
(protected) template()
- Source:
template