Issue #2456225 by nod_, drupaldrop, droplet: Improve formUpdated event

8.0.x
Alex Pott 2015-05-28 23:21:38 +01:00
parent 34e94f04e6
commit a9f2eead74
3 changed files with 4 additions and 3 deletions

View File

@ -212,6 +212,7 @@ drupal.machine-name:
- core/jquery.once
- core/drupal
- core/drupalSettings
- core/drupal.form
drupal.progress:
version: VERSION

View File

@ -134,7 +134,7 @@
// Initialize form behaviors, use $.makeArray to be able to use native
// forEach array method and have the callback parameters in the right order.
$.makeArray($forms).forEach(function (form) {
var events = 'change.formUpdated keypress.formUpdated';
var events = 'change.formUpdated input.formUpdated ';
var eventHandler = debounce(function (event) { triggerFormUpdated(event.target); }, 300);
formFields = fieldsList(form).join(',');

View File

@ -132,9 +132,9 @@
// changes, but only if there is no machine name yet; i.e., only upon
// initial creation, not when editing.
if ($target.val() === '') {
$source.on('keyup.machineName change.machineName input.machineName', eventData, machineNameHandler)
$source.on('formUpdated.machineName', eventData, machineNameHandler)
// Initialize machine name preview.
.trigger('keyup');
.trigger('formUpdated.machineName');
}
// Add a listener for an invalid event on the machine name input