Check if New and Upload buttons exist before adding their width to the total breadcrumbs width

This commit is contained in:
Michael Gapczynski 2012-08-06 17:33:50 -04:00
parent a96a75c263
commit 7c0a5d4a59
1 changed files with 5 additions and 1 deletions

View File

@ -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) {