Commit 478ddd31 authored by webchick's avatar webchick

Issue #2894283 by droplet, drpal: Improve Toolbar Height calculation to...

Issue #2894283 by droplet, drpal: Improve Toolbar Height calculation to accommodate jQuery 3.0 changes
parent 44bc1e41
......@@ -65,7 +65,9 @@
* @augments Backbone.View
*/
updateToolbarHeight() {
this.model.set('height', $('#toolbar-bar').find('.toolbar-tab').outerHeight() + $('.is-active.toolbar-tray-horizontal').outerHeight());
const toolbarTabOuterHeight = $('#toolbar-bar').find('.toolbar-tab').outerHeight() || 0;
const toolbarTrayHorizontalOuterHeight = $('.is-active.toolbar-tray-horizontal').outerHeight() || 0;
this.model.set('height', toolbarTabOuterHeight + toolbarTrayHorizontalOuterHeight);
$('body').css({
'padding-top': this.model.get('height'),
......
......@@ -33,7 +33,9 @@
this.model.trigger('change:activeTab');
},
updateToolbarHeight: function updateToolbarHeight() {
this.model.set('height', $('#toolbar-bar').find('.toolbar-tab').outerHeight() + $('.is-active.toolbar-tray-horizontal').outerHeight());
var toolbarTabOuterHeight = $('#toolbar-bar').find('.toolbar-tab').outerHeight() || 0;
var toolbarTrayHorizontalOuterHeight = $('.is-active.toolbar-tray-horizontal').outerHeight() || 0;
this.model.set('height', toolbarTabOuterHeight + toolbarTrayHorizontalOuterHeight);
$('body').css({
'padding-top': this.model.get('height')
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment