|
|
|
@ -121,21 +121,19 @@ export default PropertyView.extend({ |
|
|
|
* @return void |
|
|
|
* */ |
|
|
|
openAssetManager() { |
|
|
|
const { em, modal } = this; |
|
|
|
const editor = em ? em.get('Editor') : ''; |
|
|
|
const { em } = this; |
|
|
|
const am = em && em.get('AssetManager'); |
|
|
|
const handleAsset = a => this.spreadUrl(isString(a) ? a : a.get('src')); |
|
|
|
|
|
|
|
if (editor) { |
|
|
|
editor.runCommand('open-assets', { |
|
|
|
types: ['image'], |
|
|
|
accept: 'image/*', |
|
|
|
target: this.getTargetModel(), |
|
|
|
onClick: handleAsset, |
|
|
|
onDblClick(asset) { |
|
|
|
modal.close(); |
|
|
|
am && |
|
|
|
am.open({ |
|
|
|
select(asset, complete) { |
|
|
|
handleAsset(asset); |
|
|
|
} |
|
|
|
complete && am.close(); |
|
|
|
}, |
|
|
|
target: this.getTargetModel(), |
|
|
|
types: ['image'], |
|
|
|
accept: 'image/*' |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
|