Updated Drupal to 8.6. This goes with the following updates because it's possible...
[yaffs-website] / web / core / modules / toolbar / js / views / BodyVisualView.es6.js
index 0b513c3e1419135d337dbb9ec85cf2e72c0e7a44..8a88c3ae23f0307c13b2ee9aad38ca325b565eb2 100644 (file)
@@ -3,35 +3,46 @@
  * A Backbone view for the body element.
  */
 
-(function ($, Drupal, Backbone) {
-  Drupal.toolbar.BodyVisualView = Backbone.View.extend(/** @lends Drupal.toolbar.BodyVisualView# */{
-    /**
-     * Adjusts the body element with the toolbar position and dimension changes.
-     *
-     * @constructs
-     *
-     * @augments Backbone.View
-     */
-    initialize() {
-      this.listenTo(this.model, 'change:activeTray ', this.render);
-      this.listenTo(this.model, 'change:isFixed change:isViewportOverflowConstrained', this.isToolbarFixed);
-    },
+(function($, Drupal, Backbone) {
+  Drupal.toolbar.BodyVisualView = Backbone.View.extend(
+    /** @lends Drupal.toolbar.BodyVisualView# */ {
+      /**
+       * Adjusts the body element with the toolbar position and dimension changes.
+       *
+       * @constructs
+       *
+       * @augments Backbone.View
+       */
+      initialize() {
+        this.listenTo(this.model, 'change:activeTray ', this.render);
+        this.listenTo(
+          this.model,
+          'change:isFixed change:isViewportOverflowConstrained',
+          this.isToolbarFixed,
+        );
+      },
 
-    isToolbarFixed() {
-      // When the toolbar is fixed, it will not scroll with page scrolling.
-      const isViewportOverflowConstrained = this.model.get('isViewportOverflowConstrained');
-      $('body').toggleClass('toolbar-fixed', (isViewportOverflowConstrained || this.model.get('isFixed')));
-    },
+      isToolbarFixed() {
+        // When the toolbar is fixed, it will not scroll with page scrolling.
+        const isViewportOverflowConstrained = this.model.get(
+          'isViewportOverflowConstrained',
+        );
+        $('body').toggleClass(
+          'toolbar-fixed',
+          isViewportOverflowConstrained || this.model.get('isFixed'),
+        );
+      },
 
-    /**
-     * @inheritdoc
-     */
-    render() {
-      $('body')
-        // Toggle the toolbar-tray-open class on the body element. The class is
-        // applied when a toolbar tray is active. Padding might be applied to
-        // the body element to prevent the tray from overlapping content.
-        .toggleClass('toolbar-tray-open', !!this.model.get('activeTray'));
+      /**
+       * @inheritdoc
+       */
+      render() {
+        $('body')
+          // Toggle the toolbar-tray-open class on the body element. The class is
+          // applied when a toolbar tray is active. Padding might be applied to
+          // the body element to prevent the tray from overlapping content.
+          .toggleClass('toolbar-tray-open', !!this.model.get('activeTray'));
+      },
     },
-  });
-}(jQuery, Drupal, Backbone));
+  );
+})(jQuery, Drupal, Backbone);