move.js 419 B

12345678910111213
  1. import $ from 'jquery';
  2. $('[data-page-move] button[name="task"][value="save"]').on('click', function() {
  3. let route = $('form#blueprints:first select[name="data[route]"]');
  4. let moveTo = $('[data-page-move] select').val();
  5. if (route.length && route.val() !== moveTo) {
  6. let selectize = route.data('selectize');
  7. route.val(moveTo);
  8. if (selectize) selectize.setValue(moveTo);
  9. }
  10. });