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

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
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 1114 matching lines...) Expand 10 before | Expand all | Expand 10 after
1125 /** 1125 /**
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 if (!decorations.length && !descendantDecorations.length) 1131 if (!decorations.length && !descendantDecorations.length)
1132 return; 1132 return;
1133 1133
1134 var colors = new Set(); 1134 var colors = new Set();
1135 var titles = []; 1135 var titles = createElement("div");
1136 1136
1137 for (var decoration of decorations) { 1137 for (var decoration of decorations) {
1138 titles.push(decoration.title); 1138 var titleElement = titles.createChild("div");
1139 titleElement.textContent = decoration.title;
1139 colors.add(decoration.color); 1140 colors.add(decoration.color);
1140 } 1141 }
1141 if (this.expanded && !decorations.length) 1142 if (this.expanded && !decorations.length)
1142 return; 1143 return;
1143 1144
1144 var descendantColors = new Set(); 1145 var descendantColors = new Set();
1145 if (descendantDecorations.length) { 1146 if (descendantDecorations.length) {
1146 titles.push(WebInspector.UIString("Children:")); 1147 var element = titles.createChild("div");
1148 element.textContent = WebInspector.UIString("Children:");
1147 for (var decoration of descendantDecorations) { 1149 for (var decoration of descendantDecorations) {
1148 titles.push(decoration.title); 1150 element = titles.createChild("div");
1151 element.style.marginLeft = "15px";
1152 element.textContent = decoration.title;
1149 descendantColors.add(decoration.color); 1153 descendantColors.add(decoration.color);
1150 } 1154 }
1151 } 1155 }
1152 1156
1153 var offset = 0; 1157 var offset = 0;
1154 processColors.call(this, colors, "elements-gutter-decoration"); 1158 processColors.call(this, colors, "elements-gutter-decoration");
1155 if (!this.expanded) 1159 if (!this.expanded)
1156 processColors.call(this, descendantColors, "elements-gutter-deco ration elements-has-decorated-children"); 1160 processColors.call(this, descendantColors, "elements-gutter-deco ration elements-has-decorated-children");
1157 WebInspector.Tooltip.install(this._decorationsElement, titles.join(" \n")); 1161 WebInspector.Tooltip.install(this._decorationsElement, titles);
1158 1162
1159 /** 1163 /**
1160 * @param {!Set<string>} colors 1164 * @param {!Set<string>} colors
1161 * @param {string} className 1165 * @param {string} className
1162 * @this {WebInspector.ElementsTreeElement} 1166 * @this {WebInspector.ElementsTreeElement}
1163 */ 1167 */
1164 function processColors(colors, className) 1168 function processColors(colors, className)
1165 { 1169 {
1166 for (var color of colors) { 1170 for (var color of colors) {
1167 var child = this._decorationsElement.createChild("div", clas sName); 1171 var child = this._decorationsElement.createChild("div", clas sName);
(...skipping 412 matching lines...) Expand 10 before | Expand all | Expand 10 after
1580 1584
1581 if (object) 1585 if (object)
1582 object.callFunction(scrollIntoView); 1586 object.callFunction(scrollIntoView);
1583 } 1587 }
1584 1588
1585 this._node.resolveToObject("", scrollIntoViewCallback); 1589 this._node.resolveToObject("", scrollIntoViewCallback);
1586 }, 1590 },
1587 1591
1588 __proto__: TreeElement.prototype 1592 __proto__: TreeElement.prototype
1589 } 1593 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698