Verified Commit 947e0790 authored by Théodore Biadala's avatar Théodore Biadala
Browse files

Issue #3367420 by lauriii, smustgrave: Generate machine names even faster

parent 570710ad
Loading
Loading
Loading
Loading
+11 −2
Original line number Diff line number Diff line
@@ -180,10 +180,19 @@
        // changes, but only if there is no machine name yet; i.e., only upon
        // initial creation, not when editing.
        if ($target[0].value === '') {
          // Listen to the 'change' and 'input' events that are fired
          // immediately as the user is typing for faster response time. This is
          // safe because the event handler doesn't include any slow
          // asynchronous operations (e.g., network requests) that could
          // accumulate.
          $source
            .on('formUpdated.machineName', eventData, machineNameHandler)
            .on(
              'change.machineName input.machineName',
              eventData,
              machineNameHandler,
            )
            // Initialize machine name preview.
            .trigger('formUpdated.machineName');
            .trigger('change.machineName');
        }
      });
    },