0
1
Fork 0
hedera-web-mindshore/forms/ecomerce/basket/index.js

38 lines
665 B
JavaScript

import './style.scss';
export default new Class({
Extends: Hedera.Form,
Template: require('./ui.xml'),
open() {
this.close();
this.isOpen = true;
Hedera.BasketChecker.check(this.conn, this.hash,
this.onBasketCheck.bind(this));
},
onBasketCheck(isOk) {
if (isOk)
this.loadUi();
},
activate() {
this.$.items.setInfo('bi', 'myBasketItem', 'hedera');
},
onConfigureClick() {
Htk.Toast.showWarning(_('RememberReconfiguringImpact'));
this.hash.setAll({form: 'ecomerce/checkout'});
},
onDeleteClick(form) {
if (confirm(_('ReallyDelete')))
form.deleteRow();
},
subtotal(form) {
return form.$.amount * form.$.price;
}
});