2015-07-23 15:58:48 +00:00
|
|
|
|
2016-09-26 09:28:47 +00:00
|
|
|
Hedera.AddressList = new Class
|
2015-07-23 15:58:48 +00:00
|
|
|
({
|
2016-09-26 09:28:47 +00:00
|
|
|
Extends: Hedera.Form
|
2015-07-23 15:58:48 +00:00
|
|
|
|
2022-05-24 10:18:44 +00:00
|
|
|
,activate: function() {
|
2022-05-28 01:18:06 +00:00
|
|
|
this.$.userModel.setInfo('c', 'myClient', 'hedera');
|
|
|
|
this.$.addresses.setInfo('a', 'myAddress', 'hedera');
|
2015-07-23 15:58:48 +00:00
|
|
|
}
|
|
|
|
|
2022-05-24 10:18:44 +00:00
|
|
|
,onAddAddressClick: function() {
|
|
|
|
this.hash.set({
|
2018-01-02 13:16:41 +00:00
|
|
|
form: 'account/address',
|
|
|
|
address: 0
|
2015-07-23 15:58:48 +00:00
|
|
|
});
|
|
|
|
}
|
|
|
|
|
2022-05-24 10:18:44 +00:00
|
|
|
,onReturnClick: function() {
|
2015-07-23 15:58:48 +00:00
|
|
|
window.history.back();
|
|
|
|
}
|
2022-05-24 10:18:44 +00:00
|
|
|
|
2022-05-24 21:11:12 +00:00
|
|
|
,onSetDefaultClick: function(event, addressId) {
|
|
|
|
if (event.defaultPrevented) return;
|
2022-05-28 01:18:06 +00:00
|
|
|
this.$.defaultAddress.value = addressId;
|
2022-05-24 10:18:44 +00:00
|
|
|
Htk.Toast.showMessage(_('DefaultAddressModified'));
|
|
|
|
}
|
2015-07-23 15:58:48 +00:00
|
|
|
|
2022-05-24 21:11:12 +00:00
|
|
|
,onRemoveAddressClick: function(form) {
|
2022-05-24 10:18:44 +00:00
|
|
|
if (confirm(_('AreYouSureDeleteAddress'))) {
|
|
|
|
form.set('isActive', false);
|
|
|
|
form.refresh();
|
2015-07-23 15:58:48 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-05-24 21:11:12 +00:00
|
|
|
,onEditAddressClick: function(id) {
|
2022-05-24 10:18:44 +00:00
|
|
|
this.hash.set({
|
2018-01-02 13:16:41 +00:00
|
|
|
form: 'account/address',
|
2022-05-24 21:11:12 +00:00
|
|
|
address: id
|
2015-07-23 15:58:48 +00:00
|
|
|
});
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|