|
|
|
@ -63,6 +63,11 @@ export const evRemoveBefore = `${evRemove}:before`; |
|
|
|
export const evCustom = `${evPfx}custom`; |
|
|
|
export const evOpen = `${evPfx}open`; |
|
|
|
export const evClose = `${evPfx}close`; |
|
|
|
export const evUpload = `${evPfx}upload`; |
|
|
|
export const evUploadStart = `${evUpload}:start`; |
|
|
|
export const evUploadEnd = `${evUpload}:end`; |
|
|
|
export const evUploadError = `${evUpload}:error`; |
|
|
|
export const evUploadRes = `${evUpload}:response`; |
|
|
|
|
|
|
|
export default () => { |
|
|
|
let c = {}; |
|
|
|
@ -89,7 +94,11 @@ export default () => { |
|
|
|
removeBefore: evRemoveBefore, |
|
|
|
custom: evCustom, |
|
|
|
open: evOpen, |
|
|
|
close: evClose |
|
|
|
close: evClose, |
|
|
|
uploadStart: evUploadStart, |
|
|
|
uploadEnd: evUploadEnd, |
|
|
|
uploadError: evUploadError, |
|
|
|
uploadResponse: evUploadRes, |
|
|
|
}, |
|
|
|
|
|
|
|
init(config = {}) { |
|
|
|
@ -121,7 +130,7 @@ export default () => { |
|
|
|
this.getAll().trigger(ev, ...data); |
|
|
|
}, |
|
|
|
|
|
|
|
__onAllEvent: debounce(function() { |
|
|
|
__onAllEvent: debounce(function () { |
|
|
|
this.__trgCustom(); |
|
|
|
}), |
|
|
|
|
|
|
|
@ -148,7 +157,7 @@ export default () => { |
|
|
|
isFunction(bhv.select) && bhv.select(res, complete); |
|
|
|
}, |
|
|
|
// extra
|
|
|
|
options: bhv.options || {} |
|
|
|
options: bhv.options || {}, |
|
|
|
}; |
|
|
|
}, |
|
|
|
|
|
|
|
@ -177,7 +186,7 @@ export default () => { |
|
|
|
cmd.run(assetCmd, { |
|
|
|
types: ['image'], |
|
|
|
select: () => {}, |
|
|
|
...options |
|
|
|
...options, |
|
|
|
}); |
|
|
|
}, |
|
|
|
|
|
|
|
@ -355,14 +364,14 @@ export default () => { |
|
|
|
collection: assetsVis, // Collection visible in asset manager
|
|
|
|
globalCollection: assets, |
|
|
|
config: c, |
|
|
|
module: this |
|
|
|
module: this, |
|
|
|
}; |
|
|
|
fu = new FileUpload(obj); |
|
|
|
obj.fu = fu; |
|
|
|
const el = am && am.el; |
|
|
|
am = new AssetsView({ |
|
|
|
el, |
|
|
|
...obj |
|
|
|
...obj, |
|
|
|
}); |
|
|
|
am.render(); |
|
|
|
} |
|
|
|
@ -469,7 +478,7 @@ export default () => { |
|
|
|
__behaviour(opts = {}) { |
|
|
|
return (this._bhv = { |
|
|
|
...(this._bhv || {}), |
|
|
|
...opts |
|
|
|
...opts, |
|
|
|
}); |
|
|
|
}, |
|
|
|
|
|
|
|
@ -487,6 +496,6 @@ export default () => { |
|
|
|
[assets, am, fu].forEach(i => (i = null)); |
|
|
|
this._bhv = {}; |
|
|
|
c = {}; |
|
|
|
} |
|
|
|
}, |
|
|
|
}; |
|
|
|
}; |
|
|
|
|