| 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 2413 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2424 function blurListener(context, event) | 2424 function blurListener(context, event) |
| 2425 { | 2425 { |
| 2426 var treeElement = this._parentPane._mouseDownTreeElement; | 2426 var treeElement = this._parentPane._mouseDownTreeElement; |
| 2427 var moveDirection = ""; | 2427 var moveDirection = ""; |
| 2428 if (treeElement === this) { | 2428 if (treeElement === this) { |
| 2429 if (isEditingName && this._parentPane._mouseDownTreeElementIsVal
ue) | 2429 if (isEditingName && this._parentPane._mouseDownTreeElementIsVal
ue) |
| 2430 moveDirection = "forward"; | 2430 moveDirection = "forward"; |
| 2431 if (!isEditingName && this._parentPane._mouseDownTreeElementIsNa
me) | 2431 if (!isEditingName && this._parentPane._mouseDownTreeElementIsNa
me) |
| 2432 moveDirection = "backward"; | 2432 moveDirection = "backward"; |
| 2433 } | 2433 } |
| 2434 this.editingCommitted((context.isEditingName ? this.name : this.valu
e) || event.target.textContent, context, moveDirection); | 2434 var text = event.target.textContent; |
| 2435 if (!context.isEditingName) |
| 2436 text = this.value || text; |
| 2437 this.editingCommitted(text, context, moveDirection); |
| 2435 } | 2438 } |
| 2436 | 2439 |
| 2437 this._originalPropertyText = this.property.propertyText; | 2440 this._originalPropertyText = this.property.propertyText; |
| 2438 | 2441 |
| 2439 this._parentPane.setEditingStyle(true); | 2442 this._parentPane.setEditingStyle(true); |
| 2440 if (selectElement.parentElement) | 2443 if (selectElement.parentElement) |
| 2441 selectElement.parentElement.scrollIntoViewIfNeeded(false); | 2444 selectElement.parentElement.scrollIntoViewIfNeeded(false); |
| 2442 | 2445 |
| 2443 var applyItemCallback = !isEditingName ? this._applyFreeFlowStyleTextEdi
t.bind(this) : undefined; | 2446 var applyItemCallback = !isEditingName ? this._applyFreeFlowStyleTextEdi
t.bind(this) : undefined; |
| 2444 this._prompt = new WebInspector.StylesSidebarPane.CSSPropertyPrompt(isEd
itingName ? WebInspector.CSSMetadata.cssPropertiesMetainfo : WebInspector.CSSMet
adata.keywordsForProperty(this.nameElement.textContent), this, isEditingName); | 2447 this._prompt = new WebInspector.StylesSidebarPane.CSSPropertyPrompt(isEd
itingName ? WebInspector.CSSMetadata.cssPropertiesMetainfo : WebInspector.CSSMet
adata.keywordsForProperty(this.nameElement.textContent), this, isEditingName); |
| (...skipping 679 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3124 WebInspector.context.addFlavorChangeListener(WebInspector.DOMNode, onNodeCha
nged); | 3127 WebInspector.context.addFlavorChangeListener(WebInspector.DOMNode, onNodeCha
nged); |
| 3125 onNodeChanged(); | 3128 onNodeChanged(); |
| 3126 return button; | 3129 return button; |
| 3127 | 3130 |
| 3128 function onNodeChanged() | 3131 function onNodeChanged() |
| 3129 { | 3132 { |
| 3130 var node = WebInspector.context.flavor(WebInspector.DOMNode); | 3133 var node = WebInspector.context.flavor(WebInspector.DOMNode); |
| 3131 button.setEnabled(!!node); | 3134 button.setEnabled(!!node); |
| 3132 } | 3135 } |
| 3133 } | 3136 } |
| OLD | NEW |