comparison core/modules/toolbar/js/views/BodyVisualView.js @ 0:4c8ae668cc8c

Initial import (non-working)
author Chris Cannam
date Wed, 29 Nov 2017 16:09:58 +0000
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:4c8ae668cc8c
1 /**
2 * DO NOT EDIT THIS FILE.
3 * See the following change record for more information,
4 * https://www.drupal.org/node/2815083
5 * @preserve
6 **/
7
8 (function ($, Drupal, Backbone) {
9 Drupal.toolbar.BodyVisualView = Backbone.View.extend({
10 initialize: function initialize() {
11 this.listenTo(this.model, 'change:activeTray ', this.render);
12 this.listenTo(this.model, 'change:isFixed change:isViewportOverflowConstrained', this.isToolbarFixed);
13 },
14 isToolbarFixed: function isToolbarFixed() {
15 var isViewportOverflowConstrained = this.model.get('isViewportOverflowConstrained');
16 $('body').toggleClass('toolbar-fixed', isViewportOverflowConstrained || this.model.get('isFixed'));
17 },
18 render: function render() {
19 $('body').toggleClass('toolbar-tray-open', !!this.model.get('activeTray'));
20 }
21 });
22 })(jQuery, Drupal, Backbone);