salix/modules/item/front/descriptor-popover/index.js

30 lines
731 B
JavaScript

import ngModule from '../module';
import DescriptorPopover from 'salix/components/descriptor-popover';
class Controller extends DescriptorPopover {
constructor(...args) {
super(...args);
this._quicklinks = {
btnThree: {
icon: 'icon-transaction',
state: `item.card.diary({id: $ctrl.id})`,
tooltip: 'Item diary'
}
};
}
get item() {
return this.entity;
}
loadData() {
return this.getData(`Items/${this.id}/getCard`)
.then(res => this.entity = res.data);
}
}
ngModule.vnComponent('vnItemDescriptorPopover', {
slotTemplate: require('./index.html'),
controller: Controller
});