]> jfr.im git - z_archive/KronOS.git/blobdiff - public/js/application.js
Merge branch 'master' of https://github.com/Mustis/WebOsProject
[z_archive/KronOS.git] / public / js / application.js
index e460d1467949f3aadf2f4c2c7e508c1f7082fde8..45e3b90aee32248ccead053dcb4c27bcb204ffd1 100644 (file)
@@ -101,20 +101,21 @@ var wos
                                'username': $('#inputUsername').val(),
                                'password': $('#inputPassword').val()
                        };
+                       self = this;
                        $.post('/account/login', loginData, function(resp) {
                                if (resp.success) {
                                        for (key in resp.data) {
                                                state[key] = resp.data[key]
                                        }
-                                       this.loadUsername();
-                                       this.loadMenuItems();
-                                       this.loadBackground();
+                                       self.loadUsername();
+                                       self.loadMenuItems();
+                                       self.loadBackground();
 
                                        $('#loginModal').modal('hide');
                                        $('#inputUsername').val("")
                                        $(".alert").remove();
                                } else {
-                                       this.showError(resp.error, 'error', '.messagebody');
+                                       self.showError(resp.error, 'error', '.messagebody');
                                }
 
                                $('#inputPassword').val("")