| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 191 { | 191 { |
| 192 var selection = document.createElement("div"); | 192 var selection = document.createElement("div"); |
| 193 selection.className = "selection"; | 193 selection.className = "selection"; |
| 194 this.listItemElement.insertBefore(selection, this.listItemElement.firstC
hild); | 194 this.listItemElement.insertBefore(selection, this.listItemElement.firstC
hild); |
| 195 }, | 195 }, |
| 196 | 196 |
| 197 _update: function() | 197 _update: function() |
| 198 { | 198 { |
| 199 var layer = /** @type {WebInspector.Layer} */ (this.representedObject); | 199 var layer = /** @type {WebInspector.Layer} */ (this.representedObject); |
| 200 var nodeId = layer.nodeIdForSelfOrAncestor(); | 200 var nodeId = layer.nodeIdForSelfOrAncestor(); |
| 201 var node = nodeId && WebInspector.domAgent.nodeForId(nodeId); | 201 var node = nodeId ? WebInspector.domAgent.nodeForId(nodeId) : null; |
| 202 var title = document.createDocumentFragment(); | 202 var title = document.createDocumentFragment(); |
| 203 title.createChild("div", "selection"); | 203 title.createChild("div", "selection"); |
| 204 title.appendChild(document.createTextNode(node ? node.appropriateSelecto
rFor(false) : "#" + layer.id())); | 204 title.appendChild(document.createTextNode(node ? WebInspector.DOMPresent
ationUtils.appropriateSelectorFor(node, false) : "#" + layer.id())); |
| 205 var details = title.createChild("span", "dimmed"); | 205 var details = title.createChild("span", "dimmed"); |
| 206 details.textContent = WebInspector.UIString(" (%d × %d)", layer.width(),
layer.height()); | 206 details.textContent = WebInspector.UIString(" (%d × %d)", layer.width(),
layer.height()); |
| 207 this.title = title; | 207 this.title = title; |
| 208 }, | 208 }, |
| 209 | 209 |
| 210 onselect: function() | 210 onselect: function() |
| 211 { | 211 { |
| 212 this._layerTree._selectedNodeChanged(this); | 212 this._layerTree._selectedNodeChanged(this); |
| 213 }, | 213 }, |
| 214 | 214 |
| 215 /** | 215 /** |
| 216 * @param {boolean} hovered | 216 * @param {boolean} hovered |
| 217 */ | 217 */ |
| 218 setHovered: function(hovered) | 218 setHovered: function(hovered) |
| 219 { | 219 { |
| 220 this.listItemElement.enableStyleClass("hovered", hovered); | 220 this.listItemElement.enableStyleClass("hovered", hovered); |
| 221 }, | 221 }, |
| 222 | 222 |
| 223 __proto__: TreeElement.prototype | 223 __proto__: TreeElement.prototype |
| 224 } | 224 } |
| OLD | NEW |