hedera-web/forms/account/address-list/address-list.js

43 lines
823 B
JavaScript

Hedera.AddressList = new Class
({
Extends: Hedera.Form
,activate: function() {
this.$('user-model').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
});
}
});