Modal.User = Modal.User || {}; Modal.User.ChangePassword = class extends _modal { /** * Get class name. * @return {string} */ getClassName() { return 'Modal.User.ChangePassword'; } /** * * @param {object} parameters * @param {string} parameters.id * @param {jQuery} parameters.$context * @param {function()} parameters.onClose */ constructor(parameters) { super(parameters); this.init(); } /** * Initialize modal. */ init() { let me = this; Server.call( this.getURI(), { func: 'apiGetModal', id: me.parameters.id }, function (data) { me.create( data.modal_id, data.modal, () => { me.changePassword(); return false; } ); }, this.parameters.$context, 'Loading change password modal...' ); } /** * Change user password. */ changePassword() { let me = this; Server.call( this.getURI(), { func: 'apiChangePassword', user_id: me.parameters.id, form: me.form(null, 'get values') }, function (data) { me.close(); }, null, 'Changing password...' ); } };