diff --git a/core/modules/toolbar/css/toolbar.module.css b/core/modules/toolbar/css/toolbar.module.css index 69eb7c2..7112195 100644 --- a/core/modules/toolbar/css/toolbar.module.css +++ b/core/modules/toolbar/css/toolbar.module.css @@ -10,6 +10,8 @@ box-sizing: border-box; } #toolbar-administration { + position: absolute; + width: 100%; font-size: small; line-height: 1; margin: 0; @@ -21,6 +23,9 @@ display: none; } } +.layout-no-sidebars { + padding-top: 79px; +} /** * Very specific overrides for Drupal system CSS. diff --git a/core/modules/toolbar/js/views/BodyVisualView.js b/core/modules/toolbar/js/views/BodyVisualView.js index 7499646..1595e7c 100644 --- a/core/modules/toolbar/js/views/BodyVisualView.js +++ b/core/modules/toolbar/js/views/BodyVisualView.js @@ -17,7 +17,15 @@ * @augments Backbone.View */ initialize: function () { - this.listenTo(this.model, 'change:orientation change:offsets change:activeTray change:isOriented change:isFixed change:isViewportOverflowConstrained', this.render); + this.listenTo(this.model, 'change:orientation change:activeTray change:isOriented change:isFixed change:isViewportOverflowConstrained', this.render); + this.listenTo(this.model, 'change:offsets', this.setToolbalHeight); + }, + + setToolbalHeight: function () { + // Apply padding to the top of the body to offset the placement of the + // toolbar bar element. + + $('body').css('padding-top', this.model.get('offsets').top); }, /** @@ -43,10 +51,8 @@ // 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')) - // Apply padding to the top of the body to offset the placement of the - // toolbar bar element. - .css('padding-top', this.model.get('offsets').top); + .toggleClass('toolbar-tray-open', !!this.model.get('activeTray')); + } });