Updated Drupal to 8.6. This goes with the following updates because it's possible...
[yaffs-website] / web / core / themes / seven / js / nav-tabs.es6.js
index cd44775808a0da19d313d25568f7fa433ad29836..2100b6608f1a139fd27c1c47bb7f1fe9435065c3 100644 (file)
@@ -5,7 +5,7 @@
  * This also supports collapsible navigable is the 'is-collapsible' class is
  * added to the main element, and a target element is included.
  */
-(function ($, Drupal) {
+(function($, Drupal) {
   function init(i, tab) {
     const $tab = $(tab);
     const $target = $tab.find('[data-drupal-nav-tabs-target]');
@@ -18,7 +18,8 @@
     function handleResize(e) {
       $tab.addClass('is-horizontal');
       const $tabs = $tab.find('.tabs');
-      const isHorizontal = $tabs.outerHeight() <= $tabs.find('.tabs__tab').outerHeight();
+      const isHorizontal =
+        $tabs.outerHeight() <= $tabs.find('.tabs__tab').outerHeight();
       $tab.toggleClass('is-horizontal', isHorizontal);
       if (isCollapsible) {
         $tab.toggleClass('is-collapse-enabled', !isHorizontal);
@@ -31,7 +32,9 @@
     $tab.addClass('position-container is-horizontal-enabled');
 
     $tab.on('click.tabs', '[data-drupal-nav-tabs-trigger]', openMenu);
-    $(window).on('resize.tabs', Drupal.debounce(handleResize, 150)).trigger('resize.tabs');
+    $(window)
+      .on('resize.tabs', Drupal.debounce(handleResize, 150))
+      .trigger('resize.tabs');
   }
 
   /**
@@ -48,4 +51,4 @@
       }
     },
   };
-}(jQuery, Drupal));
+})(jQuery, Drupal);