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

44 lines
807 B
JavaScript

import './style.scss';
export default new Class({
Extends: Hedera.Form,
Template: require('./ui.xml')
,activate() {
this.$.userModel.setInfo('c', 'myClient', 'hedera');
this.$.addresses.setInfo('a', 'myAddress', 'hedera');
}
,onAddAddressClick() {
this.hash.setAll({
form: 'account/address',
address: 0
});
}
,onReturnClick() {
window.history.back();
}
,onSetDefaultClick(event, addressId) {
if (event.defaultPrevented) return;
this.$.defaultAddress.value = addressId;
Htk.Toast.showMessage(_('DefaultAddressModified'));
}
,onRemoveAddressClick(form) {
if (confirm(_('AreYouSureDeleteAddress'))) {
form.set('isActive', false);
form.refresh();
}
}
,onEditAddressClick(id) {
this.hash.setAll({
form: 'account/address',
address: id
});
}
});