Browse Source

Add the possibility to open the modal with title and content via options

`editor.Modal.open({ title: 'Title', content: 'Content' })`
pull/1359/head
Artur Arseniev 8 years ago
parent
commit
d7a8212af2
  1. 7
      src/modal_dialog/index.js

7
src/modal_dialog/index.js

@ -70,9 +70,14 @@ module.exports = () => {
/** /**
* Open the modal window * 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} * @return {this}
*/ */
open() { open(opts = {}) {
opts.title && this.setTitle(opts.title);
opts.content && this.setContent(opts.content);
modal.show(); modal.show();
return this; return this;
}, },

Loading…
Cancel
Save