Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(211)

Unified Diff: Source/devtools/front_end/elements/ElementsBreadcrumbs.js

Issue 1312033008: Devtools UI: Upgrade breadcrumbs to material design UI (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | Source/devtools/front_end/elements/ElementsPanel.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/devtools/front_end/elements/ElementsBreadcrumbs.js
diff --git a/Source/devtools/front_end/elements/ElementsBreadcrumbs.js b/Source/devtools/front_end/elements/ElementsBreadcrumbs.js
index 0b1c4e4d737abc1beec7efaaf86a0025af4d49b3..423acf155f99e8c7603fede827418db723dbe173 100644
--- a/Source/devtools/front_end/elements/ElementsBreadcrumbs.js
+++ b/Source/devtools/front_end/elements/ElementsBreadcrumbs.js
@@ -222,10 +222,11 @@ WebInspector.ElementsBreadcrumbs.prototype = {
// Layout 1: Measure total and normal crumb sizes
var contentElementWidth = this.contentElement.offsetWidth;
+ var margin = parseInt(window.getComputedStyle(/** @type {!Element} */(crumbs.firstChild)).marginLeft, 10) * 2;
pfeldman 2015/09/17 17:46:00 We should not use getComputedStyle.
var normalSizes = [];
for (var i = 0; i < crumbs.childNodes.length; ++i) {
var crumb = crumbs.childNodes[i];
- normalSizes[i] = crumb.offsetWidth;
+ normalSizes[i] = crumb.offsetWidth + margin;
}
// Layout 2: Measure collapsed crumb sizes
@@ -236,12 +237,12 @@ WebInspector.ElementsBreadcrumbs.prototype = {
}
for (var i = 0; i < crumbs.childNodes.length; ++i) {
var crumb = crumbs.childNodes[i];
- compactSizes[i] = crumb.offsetWidth;
+ compactSizes[i] = crumb.offsetWidth + margin;
}
// Layout 3: Measure collapsed crumb size
crumbs.firstChild.classList.add("collapsed");
- var collapsedSize = crumbs.firstChild.offsetWidth;
+ var collapsedSize = crumbs.firstChild.offsetWidth + margin;
// Clean up.
for (var i = 0; i < crumbs.childNodes.length; ++i) {
@@ -262,7 +263,7 @@ WebInspector.ElementsBreadcrumbs.prototype = {
}
totalSize += crumb.classList.contains("compact") ? compactSizes[i] : normalSizes[i];
}
- const rightPadding = 10;
+ const rightPadding = 4;
return totalSize + rightPadding < contentElementWidth;
}
« no previous file with comments | « no previous file | Source/devtools/front_end/elements/ElementsPanel.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698