Browse Source

Prevent custom trigger without container

pull/3795/head
Artur Arseniev 5 years ago
parent
commit
9b05ac6177
  1. 2
      docs/modules/Assets.md
  2. 3
      src/asset_manager/index.js

2
docs/modules/Assets.md

@ -337,7 +337,7 @@ editor.on('asset:custom', props => {
// props.close (Function) - A callback to close the Asset Manager
// props.remove (Function<Asset>) - A callback to remove an asset
// props.select (Function<Asset, boolean>) - A callback to select an asset
// props.container (HTMLElement) - The element where you can append your UI
// props.container (HTMLElement) - The element where you should append your UI
// Here you would put the logic to render/update your UI.
});

3
src/asset_manager/index.js

@ -119,6 +119,9 @@ export default () => {
__trgCustom: debounce(function() {
const bhv = this.__getBehaviour();
if (!bhv.container && !this.getConfig('custom').open) {
return;
}
this.em.trigger(this.events.custom, {
am: this,
open: this.isOpen(),

Loading…
Cancel
Save