gitlab-org--gitlab-foss/app/assets/javascripts/transfer_edit.js
Jan Beckmann c27f619c2a Disable "transfer group" button when no parent group is selected
Refactor project_edit.js to be reusable for this purpose

Closes #64799
2019-09-11 14:28:34 +00:00

11 lines
367 B
JavaScript

import $ from 'jquery';
export default function setupTransferEdit(formSelector, targetSelector) {
const $transferForm = $(formSelector);
const $selectNamespace = $transferForm.find(targetSelector);
$selectNamespace.on('change', () => {
$transferForm.find(':submit').prop('disabled', !$selectNamespace.val());
});
$selectNamespace.trigger('change');
}