diff options
author | Tim Zallmann <tzallmann@gitlab.com> | 2017-07-28 10:57:11 +0200 |
---|---|---|
committer | Tim Zallmann <tzallmann@gitlab.com> | 2017-07-28 10:57:11 +0200 |
commit | 8663b63af34f7b79930ad94c39e128c4c28e2a1d (patch) | |
tree | c17153e7a7c160264f77fb77493801d6e8a9d967 | |
parent | b762b254335372881ede4f6aa8c4dbb0aaf655da (diff) | |
download | gitlab-ce-8663b63af34f7b79930ad94c39e128c4c28e2a1d.tar.gz |
Updated Event Handlers based on MR discussion
-rw-r--r-- | app/assets/javascripts/projects/project_new.js | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/app/assets/javascripts/projects/project_new.js b/app/assets/javascripts/projects/project_new.js index e3fcf218cfb..2091b275c3d 100644 --- a/app/assets/javascripts/projects/project_new.js +++ b/app/assets/javascripts/projects/project_new.js @@ -2,30 +2,30 @@ document.addEventListener('DOMContentLoaded', () => { const importBtnTooltip = 'Please enter a valid project name.'; const $importBtnWrapper = $('.import_gitlab_project'); - $('.how_to_import_link').bind('click', (e) => { + $('.how_to_import_link').on('click', (e) => { e.preventDefault(); $('.how_to_import_link').next('.modal').show(); }); - $('.modal-header .close').bind('click', () => { + $('.modal-header .close').on('click', () => { $('.modal').hide(); }); - $('.btn_import_gitlab_project').bind('click', () => { + $('.btn_import_gitlab_project').on('click', () => { const importHref = $('a.btn_import_gitlab_project').attr('href'); $('.btn_import_gitlab_project').attr('href', `${importHref}?namespace_id=${$('#project_namespace_id').val()}&path=${$('#project_path').val()}`); }); - $('.btn_import_gitlab_project').attr('disabled', $('#project_path').val().trim().length === 0); + $('.btn_import_gitlab_project').attr('disabled', !$('#project_path').val().trim().length); $importBtnWrapper.attr('title', importBtnTooltip); - $('#new_project').submit(() => { + $('#new_project').on('submit', () => { const $path = $('#project_path'); $path.val($path.val().trim()); }); - $('#project_path').keyup(() => { - if ($('#project_path').val().trim().length !== 0) { + $('#project_path').on('keyup', () => { + if ($('#project_path').val().trim().length) { $('.btn_import_gitlab_project').attr('disabled', false); $importBtnWrapper.attr('title', ''); $importBtnWrapper.removeClass('has-tooltip'); @@ -36,7 +36,7 @@ document.addEventListener('DOMContentLoaded', () => { }); $('#project_import_url').disable(); - $('.import_git').click(() => { + $('.import_git').on('click', () => { const $projectImportUrl = $('#project_import_url'); $projectImportUrl.attr('disabled', !$projectImportUrl.attr('disabled')); }); |