|
|
|
@ -81,11 +81,6 @@ export default () => { |
|
|
|
removeBefore: evRemoveBefore |
|
|
|
}, |
|
|
|
|
|
|
|
/** |
|
|
|
* Initialize module |
|
|
|
* @param {Object} config Configurations |
|
|
|
* @private |
|
|
|
*/ |
|
|
|
init(config = {}) { |
|
|
|
c = { ...defaults, ...config }; |
|
|
|
const ppfx = c.pStylePrefix; |
|
|
|
@ -115,6 +110,24 @@ export default () => { |
|
|
|
this.getAll().trigger(ev, ...data); |
|
|
|
}, |
|
|
|
|
|
|
|
/** |
|
|
|
* Open the asset manager. |
|
|
|
* @param {Object} [options] Options for the asset manager. |
|
|
|
* @param {Array<String} [options.types=['image']] Types of assets to show. |
|
|
|
*/ |
|
|
|
open(options = {}) { |
|
|
|
const cmd = this.em.get('Commands'); |
|
|
|
cmd.run('open-assets', options); |
|
|
|
}, |
|
|
|
|
|
|
|
/** |
|
|
|
* Close the asset manager. |
|
|
|
*/ |
|
|
|
close() { |
|
|
|
const cmd = this.em.get('Commands'); |
|
|
|
cmd.stop('open-assets'); |
|
|
|
}, |
|
|
|
|
|
|
|
/** |
|
|
|
* Add new asset/s to the collection. URLs are supposed to be unique |
|
|
|
* @param {String|Object|Array<String>|Array<Object>} asset URL strings or an objects representing the resource. |
|
|
|
|