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

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 titles.createTextChild(decoration.title);
dgozman 2015/08/28 00:16:32 Should be div, or they would collapse.
samli 2015/08/28 01:32:14 done.
1139 colors.add(decoration.color); 1139 colors.add(decoration.color);
1140 } 1140 }
1141 if (this.expanded && !decorations.length) 1141 if (this.expanded && !decorations.length)
1142 return; 1142 return;
1143 1143
1144 var descendantColors = new Set(); 1144 var descendantColors = new Set();
1145 if (descendantDecorations.length) { 1145 if (descendantDecorations.length) {
1146 titles.push(WebInspector.UIString("Children:")); 1146 var element = titles.createChild("div");
1147 element.textContent = WebInspector.UIString("Children:");
1147 for (var decoration of descendantDecorations) { 1148 for (var decoration of descendantDecorations) {
1148 titles.push(decoration.title); 1149 element = titles.createChild("div");
1150 element.style.marginLeft = "15px";
1151 element.textContent = decoration.title;
1149 descendantColors.add(decoration.color); 1152 descendantColors.add(decoration.color);
1150 } 1153 }
1151 } 1154 }
1152 1155
1153 var offset = 0; 1156 var offset = 0;
1154 processColors.call(this, colors, "elements-gutter-decoration"); 1157 processColors.call(this, colors, "elements-gutter-decoration");
1155 if (!this.expanded) 1158 if (!this.expanded)
1156 processColors.call(this, descendantColors, "elements-gutter-deco ration elements-has-decorated-children"); 1159 processColors.call(this, descendantColors, "elements-gutter-deco ration elements-has-decorated-children");
1157 WebInspector.Tooltip.install(this._decorationsElement, titles.join(" \n")); 1160 WebInspector.Tooltip.install(this._decorationsElement, titles);
1158 1161
1159 /** 1162 /**
1160 * @param {!Set<string>} colors 1163 * @param {!Set<string>} colors
1161 * @param {string} className 1164 * @param {string} className
1162 * @this {WebInspector.ElementsTreeElement} 1165 * @this {WebInspector.ElementsTreeElement}
1163 */ 1166 */
1164 function processColors(colors, className) 1167 function processColors(colors, className)
1165 { 1168 {
1166 for (var color of colors) { 1169 for (var color of colors) {
1167 var child = this._decorationsElement.createChild("div", clas sName); 1170 var child = this._decorationsElement.createChild("div", clas sName);
(...skipping 412 matching lines...) Expand 10 before | Expand all | Expand 10 after
1580 1583
1581 if (object) 1584 if (object)
1582 object.callFunction(scrollIntoView); 1585 object.callFunction(scrollIntoView);
1583 } 1586 }
1584 1587
1585 this._node.resolveToObject("", scrollIntoViewCallback); 1588 this._node.resolveToObject("", scrollIntoViewCallback);
1586 }, 1589 },
1587 1590
1588 __proto__: TreeElement.prototype 1591 __proto__: TreeElement.prototype
1589 } 1592 }
OLDNEW
« no previous file with comments | « no previous file | Source/devtools/front_end/emulation/MediaQueryInspector.js » ('j') | Source/devtools/front_end/ui/Tooltip.js » ('J')

Powered by Google App Engine
This is Rietveld 408576698