diff --git a/modules/backend/assets/js/october.layout.js b/modules/backend/assets/js/october.layout.js index de3452e79..2c93cd896 100644 --- a/modules/backend/assets/js/october.layout.js +++ b/modules/backend/assets/js/october.layout.js @@ -13,16 +13,26 @@ } OctoberLayout.prototype.updateLayout = function(title) { - $('.layout-cell.width-fix').each(function(){ - var $el = $(this).children(); - if ($el.length > 0) { - var margin = $el.data('oc.layoutMargin'); - if (margin === undefined) { - margin = parseInt($el.css('marginRight')) + parseInt($el.css('marginLeft')) - $el.data('oc.layoutMargin', margin) - } + var $children, $el, fixedWidth, margin - $(this).width($el.get(0).offsetWidth + margin) + $('.layout-cell.width-fix').each(function(){ + $children = $(this).children() + + if ($children.length > 0) { + fixedWidth = 0 + + $children.each(function() { + $el = $(this) + margin = $el.data('oc.layoutMargin') + + if (margin === undefined) { + margin = parseInt($el.css('marginRight')) + parseInt($el.css('marginLeft')) + $el.data('oc.layoutMargin', margin) + } + fixedWidth += $el.get(0).offsetWidth + margin + }) + + $(this).width(fixedWidth) $(this).trigger('oc.widthFixed') } }) diff --git a/modules/backend/assets/js/october.navbar.js b/modules/backend/assets/js/october.navbar.js index 506f431b9..e6e5fc768 100644 --- a/modules/backend/assets/js/october.navbar.js +++ b/modules/backend/assets/js/october.navbar.js @@ -4,7 +4,7 @@ * When the icon is clicked, the menu content is displayed on the left side of the page. * - If the content doesn't fit the navbar, it can be dragged left and right. * - * Dependences: + * Dependences: * - DragScroll (october.dragscroll.js) * - VerticalMenu (october.verticalmenu.js) */ @@ -25,8 +25,9 @@ $('.layout-cell.width-fix', navbar).one('oc.widthFixed', function(){ var dragScroll = $('[data-control=toolbar]', navbar).data('oc.dragScroll') - if (dragScroll) + if (dragScroll) { dragScroll.goToElement($('ul.nav > li.active', navbar), undefined, {'duration': 0}) + } }) }) })