43 lines
813 B
JavaScript
43 lines
813 B
JavaScript
|
|
Hedera.AddressList = new Class
|
|
({
|
|
Extends: Hedera.Form
|
|
|
|
,activate: function() {
|
|
this.$.userModel.setInfo('c', 'myClient', 'hedera');
|
|
this.$.addresses.setInfo('a', 'myAddress', 'hedera');
|
|
}
|
|
|
|
,onAddAddressClick: function() {
|
|
this.hash.set({
|
|
form: 'account/address',
|
|
address: 0
|
|
});
|
|
}
|
|
|
|
,onReturnClick: function() {
|
|
window.history.back();
|
|
}
|
|
|
|
,onSetDefaultClick: function(event, addressId) {
|
|
if (event.defaultPrevented) return;
|
|
this.$.defaultAddress.value = addressId;
|
|
Htk.Toast.showMessage(_('DefaultAddressModified'));
|
|
}
|
|
|
|
,onRemoveAddressClick: function(form) {
|
|
if (confirm(_('AreYouSureDeleteAddress'))) {
|
|
form.set('isActive', false);
|
|
form.refresh();
|
|
}
|
|
}
|
|
|
|
,onEditAddressClick: function(id) {
|
|
this.hash.set({
|
|
form: 'account/address',
|
|
address: id
|
|
});
|
|
}
|
|
});
|
|
|