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 fe6450002d
commit de7f48b050
1 changed files with 5 additions and 1 deletions

View File

@ -536,7 +536,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) {
@ -544,6 +544,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) {