aboutsummaryrefslogtreecommitdiffstats
path: root/fg21sim/webui/static/js/login.js
blob: 301de73eed2dbad7b6133b2591f214a69427ddc9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
/**
 * Copyright (c) 2016 Weitian LI <liweitianux@live.com>
 * MIT license
 *
 * JavaScript codes for the Web UI of "fg21sim"
 */

"use strict";


$(document).ready(function () {
  /**
   * Submit the login form on "Enter" key
   * Credit: https://stackoverflow.com/a/12518467/4856091
   */
  $("form#login input").keypress(function (e) {
    if (e.which === 13) {
      // "Enter" key pressed
      $(e.target).closest("form").submit();
      return false;
    }
  });
});