Skip to content

Commit

Permalink
Add the possibility to open the modal with title and content via options
Browse files Browse the repository at this point in the history
`editor.Modal.open({ title: 'Title', content: 'Content' })`
  • Loading branch information
artf committed Jul 21, 2018
1 parent 4782410 commit d7a8212
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/modal_dialog/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,14 @@ module.exports = () => {

/**
* Open the modal window
* @param {Object} [opts={}] Options
* @param {String|HTMLElement} [opts.title] Title to set for the modal
* @param {String|HTMLElement} [opts.content] Content to set for the modal
* @return {this}
*/
open() {
open(opts = {}) {
opts.title && this.setTitle(opts.title);
opts.content && this.setContent(opts.content);
modal.show();
return this;
},
Expand Down

0 comments on commit d7a8212

Please sign in to comment.