hedera-web/forms/ecomerce/basket/basket.js

39 lines
660 B
JavaScript

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