diff --git a/src/style_manager/view/PropertyFileView.js b/src/style_manager/view/PropertyFileView.js index 7cacad141..ad9123265 100644 --- a/src/style_manager/view/PropertyFileView.js +++ b/src/style_manager/view/PropertyFileView.js @@ -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/*' }); - } } });