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

62 lines
946 B
JavaScript
Raw Normal View History

2015-02-01 03:21:54 +00:00
Vn.Basket = new Class
({
Extends: Vn.Form
,open: function ()
{
if (this.basketChecked)
this.parent ();
}
2015-07-10 12:30:08 +00:00
,activate: function ()
{
Vn.BasketChecker.check (this.conn,
2015-07-15 13:39:07 +00:00
this.onBasketCheck.bind (this));
2015-07-10 12:30:08 +00:00
}
2015-02-01 03:21:54 +00:00
,onBasketCheck: function (isOk)
2015-02-01 03:21:54 +00:00
{
if (!isOk)
return;
this.basketChecked = true;
this.open ();
2015-02-01 03:21:54 +00:00
}
,onConfigureClick: function ()
2015-02-01 03:21:54 +00:00
{
2015-08-17 18:02:14 +00:00
Htk.Toast.showWarning (_('RememberReconfiguringImpact'));
2015-07-10 12:30:08 +00:00
this.hash.set ({'form': 'ecomerce/checkout'});
2015-02-01 03:21:54 +00:00
}
,onCatalogClick: function ()
{
this.hash.set ({'form': 'ecomerce/catalog'});
}
,onCheckoutClick: function ()
2015-02-01 03:21:54 +00:00
{
this.hash.set ({'form': 'ecomerce/confirm'});
}
,repeaterFunc: function (res, form)
{
res.$('subtotal').value = this.subtotal (form);
}
,onDeleteClick: function (button, form)
{
if (confirm (_('ReallyDelete')))
form.deleteRow ();
}
,subtotal: function (form)
{
return form.get ('amount') * form.get ('price');
}
});
2015-07-10 12:30:08 +00:00