Fix 95-login.js
[plack-app-gruntmaster.git] / js / 95-login.js
index 3173895e5d03ff386e1cfe1d5bad4393cdb86100..d08150ae1983d2b396cbf269339f5f729538997e 100644 (file)
@@ -3,13 +3,13 @@ $(function(){
        var login = document.createElement('div');
        login.innerHTML = '<a role="button" id="login" class="show">Log in</a>';
        sidebar.insertBefore(login, sidebar.firstChild);
-       $('#login').on('click', function(e) {
+       $('#login').on('click', e => {
                var xhr = new XMLHttpRequest();
                xhr.open('GET', '/login');
-               xhr.onload = function () {
-                       if(this.status != 200)
+               xhr.onload = () => {
+                       if(xhr.status != 200)
                                return;
-                       var username = this.responseText;
+                       var username = xhr.responseText;
                        sessionStorage.setItem('login_username', username);
                        start_tracking(username);
                        login.innerHTML = 'Probably logged in as ' + username;
This page took 0.010322 seconds and 4 git commands to generate.