Updated Drupal to 8.6. This goes with the following updates because it's possible...
[yaffs-website] / web / core / modules / book / book.es6.js
index c04929bf2041706f4822122221f78603d22a8327..deb518ba9b3ab5050bfb7650ec82f664860ceab0 100644 (file)
@@ -3,7 +3,7 @@
  * Javascript behaviors for the Book module.
  */
 
-(function ($, Drupal) {
+(function($, Drupal) {
   /**
    * Adds summaries to the book outline form.
    *
    */
   Drupal.behaviors.bookDetailsSummaries = {
     attach(context) {
-      $(context).find('.book-outline-form').drupalSetSummary((context) => {
-        const $select = $(context).find('.book-title-select');
-        const val = $select.val();
+      $(context)
+        .find('.book-outline-form')
+        .drupalSetSummary(context => {
+          const $select = $(context).find('.book-title-select');
+          const val = $select.val();
 
-        if (val === '0') {
-          return Drupal.t('Not in book');
-        }
-        else if (val === 'new') {
-          return Drupal.t('New book');
-        }
+          if (val === '0') {
+            return Drupal.t('Not in book');
+          }
+          if (val === 'new') {
+            return Drupal.t('New book');
+          }
 
-        return Drupal.checkPlain($select.find(':selected').text());
-      });
+          return Drupal.checkPlain($select.find(':selected').text());
+        });
     },
   };
-}(jQuery, Drupal));
+})(jQuery, Drupal);