| 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 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 125 node = nextNode; | 125 node = nextNode; |
| 126 } | 126 } |
| 127 } | 127 } |
| 128 }, | 128 }, |
| 129 | 129 |
| 130 /** | 130 /** |
| 131 * @param {!Event} event | 131 * @param {!Event} event |
| 132 */ | 132 */ |
| 133 _onMouseMove: function(event) | 133 _onMouseMove: function(event) |
| 134 { | 134 { |
| 135 var node = this._treeOutline.treeElementFromPoint(event.pageX, event.pag
eY); | 135 var node = this._treeOutline.treeElementFromEvent(event); |
| 136 if (node === this._lastHoveredNode) | 136 if (node === this._lastHoveredNode) |
| 137 return; | 137 return; |
| 138 this.dispatchEventToListeners(WebInspector.LayerTreeOutline.Events.Layer
Hovered, node && node.representedObject ? {layer: node.representedObject} : null
); | 138 this.dispatchEventToListeners(WebInspector.LayerTreeOutline.Events.Layer
Hovered, node && node.representedObject ? {layer: node.representedObject} : null
); |
| 139 }, | 139 }, |
| 140 | 140 |
| 141 /** | 141 /** |
| 142 * @param {!WebInspector.LayerTreeElement} node | 142 * @param {!WebInspector.LayerTreeElement} node |
| 143 */ | 143 */ |
| 144 _selectedNodeChanged: function(node) | 144 _selectedNodeChanged: function(node) |
| 145 { | 145 { |
| 146 var layer = /** @type {!WebInspector.Layer} */ (node.representedObject); | 146 var layer = /** @type {!WebInspector.Layer} */ (node.representedObject); |
| 147 this.dispatchEventToListeners(WebInspector.LayerTreeOutline.Events.Layer
Selected, {layer: layer}); | 147 this.dispatchEventToListeners(WebInspector.LayerTreeOutline.Events.Layer
Selected, {layer: layer}); |
| 148 }, | 148 }, |
| 149 | 149 |
| 150 /** | 150 /** |
| 151 * @param {!Event} event | 151 * @param {!Event} event |
| 152 */ | 152 */ |
| 153 _onContextMenu: function(event) | 153 _onContextMenu: function(event) |
| 154 { | 154 { |
| 155 var node = this._treeOutline.treeElementFromPoint(event.pageX, event.pag
eY); | 155 var node = this._treeOutline.treeElementFromEvent(event); |
| 156 if (!node || !node.representedObject) | 156 if (!node || !node.representedObject) |
| 157 return; | 157 return; |
| 158 var layer = /** @type {!WebInspector.Layer} */ (node.representedObject); | 158 var layer = /** @type {!WebInspector.Layer} */ (node.representedObject); |
| 159 if (!layer) | 159 if (!layer) |
| 160 return; | 160 return; |
| 161 var domNode = layer.nodeForSelfOrAncestor(); | 161 var domNode = layer.nodeForSelfOrAncestor(); |
| 162 if (!domNode) | 162 if (!domNode) |
| 163 return; | 163 return; |
| 164 var contextMenu = new WebInspector.ContextMenu(event); | 164 var contextMenu = new WebInspector.ContextMenu(event); |
| 165 contextMenu.appendApplicableItems(domNode); | 165 contextMenu.appendApplicableItems(domNode); |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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.classList.toggle("hovered", hovered); | 220 this.listItemElement.classList.toggle("hovered", hovered); |
| 221 }, | 221 }, |
| 222 | 222 |
| 223 __proto__: TreeElement.prototype | 223 __proto__: TreeElement.prototype |
| 224 } | 224 } |
| OLD | NEW |