salix/modules/item/front/index/index.js

31 lines
701 B
JavaScript
Raw Normal View History

2017-12-19 10:05:07 +00:00
import ngModule from '../module';
2020-03-17 13:43:46 +00:00
import Section from 'salix/components/section';
2018-02-22 07:18:57 +00:00
import './style.scss';
2017-12-19 10:05:07 +00:00
2020-03-17 13:43:46 +00:00
class Controller extends Section {
constructor($element, $) {
super($element, $);
2019-02-13 08:27:11 +00:00
this.showFields = {
id: false,
actions: false
};
}
2020-04-25 09:50:04 +00:00
onCloneAccept(itemFk) {
return this.$http.post(`Items/${itemFk}/clone`)
.then(res => {
this.$state.go('item.card.tags', {id: res.data.id});
2020-04-25 09:50:04 +00:00
});
2018-02-22 12:40:23 +00:00
}
2020-04-25 09:50:04 +00:00
preview(item) {
2018-02-22 07:18:57 +00:00
this.itemSelected = item;
this.$.preview.show();
2018-02-22 07:18:57 +00:00
}
2017-12-19 10:05:07 +00:00
}
2020-03-17 13:43:46 +00:00
ngModule.vnComponent('vnItemIndex', {
template: require('./index.html'),
controller: Controller
2017-12-19 10:05:07 +00:00
});