3 * A Backbone view for the body element.
6 (function($, Drupal, Backbone) {
7 Drupal.toolbar.BodyVisualView = Backbone.View.extend(
8 /** @lends Drupal.toolbar.BodyVisualView# */ {
10 * Adjusts the body element with the toolbar position and dimension changes.
14 * @augments Backbone.View
17 this.listenTo(this.model, 'change:activeTray ', this.render);
20 'change:isFixed change:isViewportOverflowConstrained',
26 // When the toolbar is fixed, it will not scroll with page scrolling.
27 const isViewportOverflowConstrained = this.model.get(
28 'isViewportOverflowConstrained',
30 $('body').toggleClass(
32 isViewportOverflowConstrained || this.model.get('isFixed'),
41 // Toggle the toolbar-tray-open class on the body element. The class is
42 // applied when a toolbar tray is active. Padding might be applied to
43 // the body element to prevent the tray from overlapping content.
44 .toggleClass('toolbar-tray-open', !!this.model.get('activeTray'));
48 })(jQuery, Drupal, Backbone);