Free and Open source Web Builder Framework. Next generation tool for building templates without coding
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.
 
 
 
 

1.7 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

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

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

Examples

modal.setContent('<div>Some HTML content</div>');

Returns this

getContent

Get the content of the modal window

Returns string