Updated Drupal to 8.6. This goes with the following updates because it's possible...
[yaffs-website] / web / core / modules / system / js / system.es6.js
index 3f365d1fad0792504409db1df77ec805c7dfb55b..62b415dad9a8fcf7db211b5fb1598e7f6e0269ee 100644 (file)
@@ -3,7 +3,7 @@
  * System behaviors.
  */
 
-(function ($, Drupal, drupalSettings) {
+(function($, Drupal, drupalSettings) {
   // Cache IDs in an array for ease of use.
   const ids = [];
 
@@ -23,7 +23,7 @@
     attach(context) {
       // List of fields IDs on which to bind the event listener.
       // Create an array of IDs to use with jQuery.
-      Object.keys(drupalSettings.copyFieldValue || {}).forEach((element) => {
+      Object.keys(drupalSettings.copyFieldValue || {}).forEach(element => {
         ids.push(element);
       });
 
         // Listen to value:copy events on all dependent fields.
         // We have to use body and not document because of the way jQuery events
         // bubble up the DOM tree.
-        $('body').once('copy-field-values').on('value:copy', this.valueTargetCopyHandler);
+        $('body')
+          .once('copy-field-values')
+          .on('value:copy', this.valueTargetCopyHandler);
         // Listen on all source elements.
-        $(`#${ids.join(', #')}`).once('copy-field-values').on('blur', this.valueSourceBlurHandler);
+        $(`#${ids.join(', #')}`)
+          .once('copy-field-values')
+          .on('blur', this.valueSourceBlurHandler);
       }
     },
     detach(context, settings, trigger) {
       if (trigger === 'unload' && ids.length) {
-        $('body').removeOnce('copy-field-values').off('value:copy');
-        $(`#${ids.join(', #')}`).removeOnce('copy-field-values').off('blur');
+        $('body')
+          .removeOnce('copy-field-values')
+          .off('value:copy');
+        $(`#${ids.join(', #')}`)
+          .removeOnce('copy-field-values')
+          .off('blur');
       }
     },
 
@@ -73,4 +81,4 @@
       $(`#${targetIds.join(', #')}`).trigger('value:copy', value);
     },
   };
-}(jQuery, Drupal, drupalSettings));
+})(jQuery, Drupal, drupalSettings);