The Jodit dialog system allows you to create modals with title, footer, and content.
Each dialog is created as a separate inheritor component [[View]].
Several basic wrappers are available out of the box to quickly create basic windows: [[Alert]]/[[Confirm]]/[[Prompt]]
Jodit.Alert('Hello world!',()=>{ // After OK }); Jodit.Confirm('Are you sure?','Confirm Dialog',yes=>{ if (yes) { // do something } }); Jodit.Prompt('Enter your name','Prompt Dialog',name=>{ if (name.length<3) { Jodit.Alert('The name must be at least 3 letters'); returnfalse; } // do something });
Each of these wrappers returns an [[IDialog]] object, and you can expand the open window.
constdialog=Jodit.Alert('Hello world!',()=>{ // After OK }); dialog.setContent('Buy buy world! =)');
Note that you do not need to call the [[Dialog.open]] method.
For a simpler setup, you can immediately create an instance [[Dialog]] and already fully manage its contents:
In all of these examples, the dialog opens regardless of Jodit's settings, specifically the selected language and theme.
To make the dialog open in the same theme as the editor, you can set the theme in its settings, or you can use the [[IDlg]] trait.
Jodit dialog system
The Jodit dialog system allows you to create modals with title, footer, and content. Each dialog is created as a separate inheritor component [[View]].
Several basic wrappers are available out of the box to quickly create basic windows: [[Alert]]/[[Confirm]]/[[Prompt]]
Each of these wrappers returns an [[IDialog]] object, and you can expand the open window.
For a simpler setup, you can immediately create an instance [[Dialog]] and already fully manage its contents:
In all of these examples, the dialog opens regardless of Jodit's settings, specifically the selected language and theme. To make the dialog open in the same theme as the editor, you can set the theme in its settings, or you can use the [[IDlg]] trait.