Browse Source

Update assetManager call in StyleManager

pull/3795/head
Artur Arseniev 5 years ago
parent
commit
f21454265c
  1. 22
      src/style_manager/view/PropertyFileView.js

22
src/style_manager/view/PropertyFileView.js

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

Loading…
Cancel
Save