forked from verdnatura/hedera-web
39 lines
674 B
JavaScript
39 lines
674 B
JavaScript
|
|
Hedera.Basket = new Class({
|
|
Extends: Hedera.Form
|
|
|
|
,open: function() {
|
|
this.close();
|
|
this.isOpen = true;
|
|
|
|
Hedera.BasketChecker.check(this.conn, this.hash,
|
|
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.setAll({form: 'ecomerce/checkout'});
|
|
}
|
|
|
|
,onDeleteClick: function(form) {
|
|
if (confirm(_('ReallyDelete')))
|
|
form.deleteRow();
|
|
}
|
|
|
|
,subtotal: function(form) {
|
|
return form.$.amount * form.$.price;
|
|
}
|
|
});
|
|
|
|
|
|
|