summaryrefslogtreecommitdiff
path: root/app/assets/javascripts/transfer_edit.js
blob: bb15e11fd4cfacef0cc62cbde24967b4dbdd70dd (plain)
1
2
3
4
5
6
7
8
9
10
11
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');
}