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

Side by Side Diff: Source/devtools/front_end/elements/ElementsTreeElement.js

Issue 1318903007: Devtools UI: Fix tooltip issues (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
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 unified diff | Download patch
« no previous file with comments | « no previous file | Source/devtools/front_end/emulation/ResponsiveDesignView.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2007, 2008 Apple Inc. All rights reserved. 2 * Copyright (C) 2007, 2008 Apple Inc. All rights reserved.
3 * Copyright (C) 2008 Matt Lilek <webkit@mattlilek.com> 3 * Copyright (C) 2008 Matt Lilek <webkit@mattlilek.com>
4 * Copyright (C) 2009 Joseph Pecoraro 4 * Copyright (C) 2009 Joseph Pecoraro
5 * 5 *
6 * Redistribution and use in source and binary forms, with or without 6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions 7 * modification, are permitted provided that the following conditions
8 * are met: 8 * are met:
9 * 9 *
10 * 1. Redistributions of source code must retain the above copyright 10 * 1. Redistributions of source code must retain the above copyright
(...skipping 1115 matching lines...) Expand 10 before | Expand all | Expand 10 after
1126 * @this {WebInspector.ElementsTreeElement} 1126 * @this {WebInspector.ElementsTreeElement}
1127 */ 1127 */
1128 function setTitle() 1128 function setTitle()
1129 { 1129 {
1130 this._decorationsElement.removeChildren(); 1130 this._decorationsElement.removeChildren();
1131 this._decorationsElement.classList.add("hidden"); 1131 this._decorationsElement.classList.add("hidden");
1132 if (!decorations.length && !descendantDecorations.length) 1132 if (!decorations.length && !descendantDecorations.length)
1133 return; 1133 return;
1134 1134
1135 var colors = new Set(); 1135 var colors = new Set();
1136 var titles = []; 1136 var titles = createElement("div");
1137 1137
1138 for (var decoration of decorations) { 1138 for (var decoration of decorations) {
1139 titles.push(decoration.title); 1139 var titleElement = titles.createChild("div");
1140 titleElement.textContent = decoration.title;
1140 colors.add(decoration.color); 1141 colors.add(decoration.color);
1141 } 1142 }
1142 if (this.expanded && !decorations.length) 1143 if (this.expanded && !decorations.length)
1143 return; 1144 return;
1144 1145
1145 var descendantColors = new Set(); 1146 var descendantColors = new Set();
1146 if (descendantDecorations.length) { 1147 if (descendantDecorations.length) {
1147 titles.push(WebInspector.UIString("Children:")); 1148 var element = titles.createChild("div");
1149 element.textContent = WebInspector.UIString("Children:");
1148 for (var decoration of descendantDecorations) { 1150 for (var decoration of descendantDecorations) {
1149 titles.push(decoration.title); 1151 element = titles.createChild("div");
1152 element.style.marginLeft = "15px";
1153 element.textContent = decoration.title;
1150 descendantColors.add(decoration.color); 1154 descendantColors.add(decoration.color);
1151 } 1155 }
1152 } 1156 }
1153 1157
1154 var offset = 0; 1158 var offset = 0;
1155 processColors.call(this, colors, "elements-gutter-decoration"); 1159 processColors.call(this, colors, "elements-gutter-decoration");
1156 if (!this.expanded) 1160 if (!this.expanded)
1157 processColors.call(this, descendantColors, "elements-gutter-deco ration elements-has-decorated-children"); 1161 processColors.call(this, descendantColors, "elements-gutter-deco ration elements-has-decorated-children");
1158 WebInspector.Tooltip.install(this._decorationsElement, titles.join(" \n")); 1162 WebInspector.Tooltip.install(this._decorationsElement, titles);
1159 1163
1160 /** 1164 /**
1161 * @param {!Set<string>} colors 1165 * @param {!Set<string>} colors
1162 * @param {string} className 1166 * @param {string} className
1163 * @this {WebInspector.ElementsTreeElement} 1167 * @this {WebInspector.ElementsTreeElement}
1164 */ 1168 */
1165 function processColors(colors, className) 1169 function processColors(colors, className)
1166 { 1170 {
1167 for (var color of colors) { 1171 for (var color of colors) {
1168 var child = this._decorationsElement.createChild("div", clas sName); 1172 var child = this._decorationsElement.createChild("div", clas sName);
(...skipping 413 matching lines...) Expand 10 before | Expand all | Expand 10 after
1582 1586
1583 if (object) 1587 if (object)
1584 object.callFunction(scrollIntoView); 1588 object.callFunction(scrollIntoView);
1585 } 1589 }
1586 1590
1587 this._node.resolveToObject("", scrollIntoViewCallback); 1591 this._node.resolveToObject("", scrollIntoViewCallback);
1588 }, 1592 },
1589 1593
1590 __proto__: TreeElement.prototype 1594 __proto__: TreeElement.prototype
1591 } 1595 }
OLDNEW
« no previous file with comments | « no previous file | Source/devtools/front_end/emulation/ResponsiveDesignView.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698