From 7c0a5d4a5933c5c9fa91956452a15d57c505284d Mon Sep 17 00:00:00 2001 From: Michael Gapczynski Date: Mon, 6 Aug 2012 17:33:50 -0400 Subject: Check if New and Upload buttons exist before adding their width to the total breadcrumbs width --- apps/files/js/files.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'apps') diff --git a/apps/files/js/files.js b/apps/files/js/files.js index c980ba003d0..049afea4f61 100644 --- a/apps/files/js/files.js +++ b/apps/files/js/files.js @@ -545,7 +545,7 @@ $(document).ready(function() { var lastWidth = 0; var breadcrumbs = []; - var breadcrumbsWidth = $('#navigation').get(0).offsetWidth + $('#controls .actions').get(0).offsetWidth; + var breadcrumbsWidth = $('#navigation').get(0).offsetWidth; var hiddenBreadcrumbs = 0; $.each($('.crumb'), function(index, breadcrumb) { @@ -553,6 +553,10 @@ $(document).ready(function() { breadcrumbsWidth += $(breadcrumb).get(0).offsetWidth; }); + if ($('#controls .actions').length > 0) { + breadcrumbsWidth += $('#controls .actions').get(0).offsetWidth; + } + function resizeBreadcrumbs(firstRun) { var width = $(this).width(); if (width != lastWidth) { -- cgit v1.2.3