Commit 9a02fd32 authored by Ezekiel Kigbo's avatar Ezekiel Kigbo

Remove transfer edit jquery

parent 1c7e9862
import $ from 'jquery';
export default function setupTransferEdit(formSelector, watchField, targetSelectorId) {
const transferForm = document.querySelector(formSelector);
console.log('formSelector', formSelector);
console.log('watchField', watchField);
console.log('transferForm', transferForm);
const field = transferForm.querySelector(watchField);
console.log('field', field);
const valueField = transferForm.querySelector(targetSelectorId);
console.log('valueField.value', valueField.value);
export default function setupTransferEdit(formSelector, targetSelector) {
const $transferForm = $(formSelector);
const $selectNamespace = $transferForm.find(targetSelector);
field.addEventListener('click', (e) => {
console.log('event::click');
$selectNamespace.on('change', () => {
$transferForm.find(':submit').prop('disabled', !$selectNamespace.val());
console.log('valueField', valueField, valueField.value);
console.log('e', e.currentTarget);
console.log('e', e.target);
transferForm
.querySelector("input[type='submit']")
// .querySelector("input[type='submit']")
.setAttribute('disabled', !valueField.val() ? 'disabled' : '');
});
$selectNamespace.trigger('change');
field.addEventListener('select', () => {
console.log('event::select');
// transferForm
// .querySelector("input[type='submit']")
// .setAttribute('disabled', !field.val() ? 'disabled' : '');
});
field.addEventListener('change', () => {
console.log('event::change');
// transferForm
// .querySelector("input[type='submit']")
// .setAttribute('disabled', !field.val() ? 'disabled' : '');
});
// field.trigger('change');
transferForm.querySelector("input[type='submit']").setAttribute('disabled', 'disabled');
}
......@@ -19,7 +19,8 @@ document.addEventListener('DOMContentLoaded', () => {
document.querySelectorAll('.js-general-settings-form, .js-general-permissions-form'),
);
mountBadgeSettings(GROUP_BADGE);
setupTransferEdit('.js-group-transfer-form', '#new_parent_group_id');
setupTransferEdit('.js-group-transfer-form', '.dropdown-group-transfer', '#new_parent_group_id');
// Initialize Subgroups selector
groupsSelect();
......
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