Check if New and Upload buttons exist before adding their width to the total breadcrumbs width
This commit is contained in:
parent
a96a75c263
commit
7c0a5d4a59
|
@ -545,7 +545,7 @@ $(document).ready(function() {
|
||||||
|
|
||||||
var lastWidth = 0;
|
var lastWidth = 0;
|
||||||
var breadcrumbs = [];
|
var breadcrumbs = [];
|
||||||
var breadcrumbsWidth = $('#navigation').get(0).offsetWidth + $('#controls .actions').get(0).offsetWidth;
|
var breadcrumbsWidth = $('#navigation').get(0).offsetWidth;
|
||||||
var hiddenBreadcrumbs = 0;
|
var hiddenBreadcrumbs = 0;
|
||||||
|
|
||||||
$.each($('.crumb'), function(index, breadcrumb) {
|
$.each($('.crumb'), function(index, breadcrumb) {
|
||||||
|
@ -553,6 +553,10 @@ $(document).ready(function() {
|
||||||
breadcrumbsWidth += $(breadcrumb).get(0).offsetWidth;
|
breadcrumbsWidth += $(breadcrumb).get(0).offsetWidth;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
if ($('#controls .actions').length > 0) {
|
||||||
|
breadcrumbsWidth += $('#controls .actions').get(0).offsetWidth;
|
||||||
|
}
|
||||||
|
|
||||||
function resizeBreadcrumbs(firstRun) {
|
function resizeBreadcrumbs(firstRun) {
|
||||||
var width = $(this).width();
|
var width = $(this).width();
|
||||||
if (width != lastWidth) {
|
if (width != lastWidth) {
|
||||||
|
|
Loading…
Reference in New Issue