mirror of https://github.com/artf/grapesjs.git
nocodeframeworkdrag-and-dropsite-buildersite-generatortemplate-builderui-builderweb-builderweb-builder-frameworkwebsite-builderno-codepage-builder
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
2.1 KiB
2.1 KiB
Modal
You can customize the initial state of the module from the editor initialization, by passing the following Configuration Object
const editor = grapesjs.init({
modal: {
// options
}
})
Once the editor is instantiated you can use its API. Before using these methods you should get the module from the instance
const modal = editor.Modal;
open
Open the modal window
Parameters
optsObject Options (optional, default{})opts.title(String | HTMLElement)? Title to set for the modalopts.content(String | HTMLElement)? Content to set for the modal
Returns this
close
Close the modal window
Returns this
isOpen
Checks if the modal window is open
Returns Boolean
setTitle
Set the title to the modal window
Parameters
titlestring Title
Examples
modal.setTitle('New title');
Returns this
getTitle
Returns the title of the modal window
Returns string
setContent
Set the content of the modal window
Parameters
content(string | HTMLElement) Content
Examples
modal.setContent('<div>Some HTML content</div>');
Returns this
getContent
Get the content of the modal window
Returns string