| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2007 Apple Inc. All rights reserved. | 2 * Copyright (C) 2007 Apple Inc. All rights reserved. |
| 3 * Copyright (C) 2009 Joseph Pecoraro | 3 * Copyright (C) 2009 Joseph Pecoraro |
| 4 * | 4 * |
| 5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
| 7 * are met: | 7 * are met: |
| 8 * | 8 * |
| 9 * 1. Redistributions of source code must retain the above copyright | 9 * 1. Redistributions of source code must retain the above copyright |
| 10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
| (...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 199 this._updateFilter(); | 199 this._updateFilter(); |
| 200 }, | 200 }, |
| 201 | 201 |
| 202 /** | 202 /** |
| 203 * @override | 203 * @override |
| 204 * @param {?WebInspector.DOMNode} node | 204 * @param {?WebInspector.DOMNode} node |
| 205 */ | 205 */ |
| 206 setNode: function(node) | 206 setNode: function(node) |
| 207 { | 207 { |
| 208 this._stylesPopoverHelper.hide(); | 208 this._stylesPopoverHelper.hide(); |
| 209 node = WebInspector.SharedSidebarModel.elementNode(node); | 209 node = node ? node.enclosingElementOrSelf() : null; |
| 210 | 210 |
| 211 this._resetCache(); | 211 this._resetCache(); |
| 212 WebInspector.ElementsSidebarPane.prototype.setNode.call(this, node); | 212 WebInspector.ElementsSidebarPane.prototype.setNode.call(this, node); |
| 213 }, | 213 }, |
| 214 | 214 |
| 215 /** | 215 /** |
| 216 * @param {!WebInspector.StylePropertiesSection=} editedSection | 216 * @param {!WebInspector.StylePropertiesSection=} editedSection |
| 217 */ | 217 */ |
| 218 _refreshUpdate: function(editedSection) | 218 _refreshUpdate: function(editedSection) |
| 219 { | 219 { |
| (...skipping 2917 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3137 WebInspector.context.addFlavorChangeListener(WebInspector.DOMNode, onNodeCha
nged); | 3137 WebInspector.context.addFlavorChangeListener(WebInspector.DOMNode, onNodeCha
nged); |
| 3138 onNodeChanged(); | 3138 onNodeChanged(); |
| 3139 return button; | 3139 return button; |
| 3140 | 3140 |
| 3141 function onNodeChanged() | 3141 function onNodeChanged() |
| 3142 { | 3142 { |
| 3143 var node = WebInspector.context.flavor(WebInspector.DOMNode); | 3143 var node = WebInspector.context.flavor(WebInspector.DOMNode); |
| 3144 button.setEnabled(!!node); | 3144 button.setEnabled(!!node); |
| 3145 } | 3145 } |
| 3146 } | 3146 } |
| OLD | NEW |