From de7f48b0509a60835643c9776bfd9e0626a76440 Mon Sep 17 00:00:00 2001
From: Michael Gapczynski <mtgap@owncloud.com>
Date: Mon, 6 Aug 2012 17:33:50 -0400
Subject: [PATCH] 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(-)

diff --git a/apps/files/js/files.js b/apps/files/js/files.js
index 1b51b0e5df9..935101e86e2 100644
--- a/apps/files/js/files.js
+++ b/apps/files/js/files.js
@@ -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) {
-- 
GitLab