salix/client/item/src/list/item-product.js

30 lines
590 B
JavaScript
Raw Normal View History

2017-12-19 13:28:19 +00:00
import ngModule from '../module';
2018-02-22 07:18:57 +00:00
class ItemProduct {
2018-03-01 20:18:43 +00:00
onClick(event) {
if (event.defaultPrevented)
event.stopImmediatePropagation();
}
clone(event) {
event.preventDefault();
2018-02-22 12:40:23 +00:00
this.ItemList.cloneItem(this.item);
2018-02-22 07:18:57 +00:00
}
2018-03-01 20:18:43 +00:00
preview(event) {
event.preventDefault();
2018-02-22 07:18:57 +00:00
this.ItemList.showItemPreview(this.item);
}
}
2017-12-19 13:28:19 +00:00
ngModule.component('vnItemProduct', {
template: require('./item-product.html'),
bindings: {
item: '<'
2018-02-22 07:18:57 +00:00
},
controller: ItemProduct,
require: {
ItemList: '^vnItemList'
2017-12-19 13:28:19 +00:00
}
});