aboutsummaryrefslogtreecommitdiffstats
path: root/web_src/js/features/user-settings.js
blob: c2f00dc362d3e6c7e045830d2c9ce7de766ea23a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
export function initUserSettings() {
  if ($('.user.settings.profile').length > 0) {
    $('#username').on('keyup', function () {
      const $prompt = $('#name-change-prompt');
      const $prompt_redirect = $('#name-change-redirect-prompt');
      if ($(this).val().toString().toLowerCase() !== $(this).data('name').toString().toLowerCase()) {
        $prompt.show();
        $prompt_redirect.show();
      } else {
        $prompt.hide();
        $prompt_redirect.hide();
      }
    });
  }
}