summaryrefslogtreecommitdiff
path: root/js/codeq/profile.js
diff options
context:
space:
mode:
authorRobert Zorko <robertz@gurucue.com>2015-10-14 15:29:12 +0200
committerRobert Zorko <robertz@gurucue.com>2015-10-14 15:29:12 +0200
commit751ee468a0f996da42bccc65a9dfee5a7b243352 (patch)
tree2da3d1617e6a9b7f2d2b2e0ecc53f79ad4a5b266 /js/codeq/profile.js
parent2fe1ceebd6287ed4835798c82498834102cb7e18 (diff)
moved the cahnged pass popup to its own screen and enabled the change pass btn in the profile screen
Diffstat (limited to 'js/codeq/profile.js')
-rw-r--r--js/codeq/profile.js30
1 files changed, 5 insertions, 25 deletions
diff --git a/js/codeq/profile.js b/js/codeq/profile.js
index 08a8883..3f4a274 100644
--- a/js/codeq/profile.js
+++ b/js/codeq/profile.js
@@ -4,31 +4,7 @@
(function(){
- $('#formChangePassword').submit(function(event) {
- var jqNew = $("#modalChangePasswordNew"),
- jqVerify = $("#modalChangePasswordVerify");
-
- if (jqNew.val() != jqVerify.val()) {
- alert('Passwords do not match.');
- }
- else {
- codeq.comms.changePassword(jqNew.val())
- .then(function (data) {
- if (data.code !== 0) throw new Error('Password change failed, code: ' + data.code + ', message: ' + data.message);
-
- $('#modalChangePassword').modal('hide');
- jqNew.val('');
- jqVerify.val('');
- alert('Password changed.');
- })
- .fail(function (reason) {
- codeq.log.error('Password change failed: ' + reason, reason);
- alert('Password change failed: ' + reason);
- })
- .done();
- }
- event.preventDefault(); // Prevent the form from submitting via the browser.
- });
+ var jqBtnChangePass = $("#change_pass_profile");
codeq.profile = {
};
@@ -74,9 +50,13 @@
alert('GetUserStat failed: ' + reason);
})
.done();
+ jqBtnChangePass.on('click',function(){
+ codeq.globalStateMachine.transition('changePassword');
+ });
},
'exit' : function(){
$("#screen_profile").css('display', 'none');
+ jqBtnChangePass.off('click');
}
});
})(); \ No newline at end of file