| 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 2071 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2082 | 2082 |
| 2083 if (this.treeOutline.section && !this.treeOutline.section.editable) | 2083 if (this.treeOutline.section && !this.treeOutline.section.editable) |
| 2084 return; | 2084 return; |
| 2085 | 2085 |
| 2086 if (!selectElement) | 2086 if (!selectElement) |
| 2087 selectElement = this.nameElement; // No arguments passed in - edit t
he name element by default. | 2087 selectElement = this.nameElement; // No arguments passed in - edit t
he name element by default. |
| 2088 else | 2088 else |
| 2089 selectElement = selectElement.enclosingNodeOrSelfWithClass("webkit-c
ss-property") || selectElement.enclosingNodeOrSelfWithClass("value"); | 2089 selectElement = selectElement.enclosingNodeOrSelfWithClass("webkit-c
ss-property") || selectElement.enclosingNodeOrSelfWithClass("value"); |
| 2090 | 2090 |
| 2091 var isEditingName = selectElement === this.nameElement; | 2091 var isEditingName = selectElement === this.nameElement; |
| 2092 if (!isEditingName) { | 2092 if (!isEditingName && selectElement !== this.valueElement) { |
| 2093 if (selectElement !== this.valueElement) { | 2093 // Double-click in the LI - start editing value. |
| 2094 // Click in the LI - start editing value. | 2094 isEditingName = false; |
| 2095 isEditingName = false; | 2095 selectElement = this.valueElement; |
| 2096 selectElement = this.valueElement; | |
| 2097 } | |
| 2098 | |
| 2099 this.valueElement.textContent = this.value; | |
| 2100 } | 2096 } |
| 2101 | 2097 |
| 2102 if (WebInspector.isBeingEdited(selectElement)) | 2098 if (WebInspector.isBeingEdited(selectElement)) |
| 2103 return; | 2099 return; |
| 2104 | 2100 |
| 2105 var context = { | 2101 var context = { |
| 2106 expanded: this.expanded, | 2102 expanded: this.expanded, |
| 2107 hasChildren: this.hasChildren, | 2103 hasChildren: this.hasChildren, |
| 2108 isEditingName: isEditingName, | 2104 isEditingName: isEditingName, |
| 2109 previousContent: selectElement.textContent | 2105 previousContent: selectElement.textContent |
| (...skipping 491 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2601 if (!prefix && !force) | 2597 if (!prefix && !force) |
| 2602 return; | 2598 return; |
| 2603 | 2599 |
| 2604 var results = this._cssCompletions.startsWith(prefix); | 2600 var results = this._cssCompletions.startsWith(prefix); |
| 2605 var selectedIndex = this._cssCompletions.mostUsedOf(results); | 2601 var selectedIndex = this._cssCompletions.mostUsedOf(results); |
| 2606 completionsReadyCallback(results, selectedIndex); | 2602 completionsReadyCallback(results, selectedIndex); |
| 2607 }, | 2603 }, |
| 2608 | 2604 |
| 2609 __proto__: WebInspector.TextPrompt.prototype | 2605 __proto__: WebInspector.TextPrompt.prototype |
| 2610 } | 2606 } |
| OLD | NEW |