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
* */
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/*'
});
}
}
});

Loading…
Cancel
Save