From ba9666c32a81411457797f78a57a6f6a80cdbb1f Mon Sep 17 00:00:00 2001 From: fukino Date: Sun, 22 Mar 2015 23:36:46 -0700 Subject: Files.app: Collapse the parent folder's path on breadcrumbs considering the minimum width. BUG=469122 TEST=manual test Review URL: https://codereview.chromium.org/1027093002 Cr-Commit-Position: refs/heads/master@{#321739} --- ui/file_manager/file_manager/foreground/js/ui/location_line.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'ui') diff --git a/ui/file_manager/file_manager/foreground/js/ui/location_line.js b/ui/file_manager/file_manager/foreground/js/ui/location_line.js index 2fc3d20..f3fe2fd 100644 --- a/ui/file_manager/file_manager/foreground/js/ui/location_line.js +++ b/ui/file_manager/file_manager/foreground/js/ui/location_line.js @@ -175,7 +175,7 @@ LocationLine.prototype.truncate = function() { if (!this.breadcrumbs_.firstChild) return; - // Assume style.width == clientWidth (items have no margins or paddings). + // Assume style.width == clientWidth (items have no margins). for (var item = this.breadcrumbs_.firstChild; item; item = item.nextSibling) { item.removeAttribute('style'); @@ -219,7 +219,8 @@ LocationLine.prototype.truncate = function() { parentCrumb.removeAttribute('collapsed'); var collapsedWidth = 0; - if (parentCrumb && pathWidth - maxPathWidth > parentCrumb.clientWidth) { + if (parentCrumb && + pathWidth - parentCrumb.clientWidth + minCrumbWidth > maxPathWidth) { // At least one crumb is hidden completely (or almost completely). // Show sign of hidden crumbs like this: // root > some di... > ... > current directory. -- cgit v1.1