Commit e5c94b1f authored by Coung Ngo's avatar Coung Ngo

Delete dead JS code

Delete code that is not executed in the following pages because
there is no `form.js-requires-input` selector on the page.

/projects/new#blank_project
- app/views/projects/_new_project_fields.html.haml

/import/manifest/new
- app/views/import/manifest/_form.html.haml

/import/phabricator/new
- app/views/import/shared/_new_project_form.html.haml
parent a6eec40a
...@@ -38,23 +38,9 @@ $.fn.requiresInput = function requiresInput() { ...@@ -38,23 +38,9 @@ $.fn.requiresInput = function requiresInput() {
$form.on('change input', fieldSelector, requireInput); $form.on('change input', fieldSelector, requireInput);
}; };
// Hide or Show the help block when creating a new project
// based on the option selected
function hideOrShowHelpBlock(form) {
const selected = $('.js-select-namespace option:selected');
if (selected.length && selected.data('optionsParent') === 'groups') {
form.find('.form-text.text-muted').hide();
} else if (selected.length) {
form.find('.form-text.text-muted').show();
}
}
$(() => { $(() => {
$('form.js-requires-input').each((i, el) => { $('form.js-requires-input').each((i, el) => {
const $form = $(el); const $form = $(el);
$form.requiresInput(); $form.requiresInput();
hideOrShowHelpBlock($form);
$('.select2.js-select-namespace').change(() => hideOrShowHelpBlock($form));
}); });
}); });
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment