| 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 2592 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2603 kickFreeFlowStyleEditForTest: function() | 2603 kickFreeFlowStyleEditForTest: function() |
| 2604 { | 2604 { |
| 2605 this._applyFreeFlowStyleTextEdit(); | 2605 this._applyFreeFlowStyleTextEdit(); |
| 2606 }, | 2606 }, |
| 2607 | 2607 |
| 2608 /** | 2608 /** |
| 2609 * @param {!WebInspector.StylePropertyTreeElement.Context} context | 2609 * @param {!WebInspector.StylePropertyTreeElement.Context} context |
| 2610 */ | 2610 */ |
| 2611 editingEnded: function(context) | 2611 editingEnded: function(context) |
| 2612 { | 2612 { |
| 2613 delete this._originalPropertyText; | |
| 2614 this._resetMouseDownElement(); | 2613 this._resetMouseDownElement(); |
| 2615 | 2614 |
| 2616 this.setExpandable(context.hasChildren); | 2615 this.setExpandable(context.hasChildren); |
| 2617 if (context.expanded) | 2616 if (context.expanded) |
| 2618 this.expand(); | 2617 this.expand(); |
| 2619 var editedElement = context.isEditingName ? this.nameElement : this.valu
eElement; | 2618 var editedElement = context.isEditingName ? this.nameElement : this.valu
eElement; |
| 2620 // The proxyElement has been deleted, no need to remove listener. | 2619 // The proxyElement has been deleted, no need to remove listener. |
| 2621 if (editedElement.parentElement) | 2620 if (editedElement.parentElement) |
| 2622 editedElement.parentElement.classList.remove("child-editing"); | 2621 editedElement.parentElement.classList.remove("child-editing"); |
| 2623 | 2622 |
| 2624 this._parentPane.setEditingStyle(false); | 2623 this._parentPane.setEditingStyle(false); |
| 2625 }, | 2624 }, |
| 2626 | 2625 |
| 2627 /** | 2626 /** |
| 2628 * @param {?Element} element | 2627 * @param {?Element} element |
| 2629 * @param {!WebInspector.StylePropertyTreeElement.Context} context | 2628 * @param {!WebInspector.StylePropertyTreeElement.Context} context |
| 2630 */ | 2629 */ |
| 2631 editingCancelled: function(element, context) | 2630 editingCancelled: function(element, context) |
| 2632 { | 2631 { |
| 2633 this._removePrompt(); | 2632 this._removePrompt(); |
| 2634 this._revertStyleUponEditingCanceled(); | 2633 this._revertStyleUponEditingCanceled(); |
| 2635 // This should happen last, as it clears the info necessary to restore t
he property value after [Page]Up/Down changes. | 2634 // This should happen last, as it clears the info necessary to restore t
he property value after [Page]Up/Down changes. |
| 2636 this.editingEnded(context); | 2635 this.editingEnded(context); |
| 2637 }, | 2636 }, |
| 2638 | 2637 |
| 2639 _revertStyleUponEditingCanceled: function() | 2638 _revertStyleUponEditingCanceled: function() |
| 2640 { | 2639 { |
| 2641 if (this._propertyHasBeenEditedIncrementally) | 2640 if (this._propertyHasBeenEditedIncrementally) { |
| 2642 this.applyStyleText(this._originalPropertyText, false); | 2641 this.applyStyleText(this._originalPropertyText, false); |
| 2643 else if (this._newProperty) | 2642 delete this._originalPropertyText; |
| 2643 } else if (this._newProperty) { |
| 2644 this.treeOutline.removeChild(this); | 2644 this.treeOutline.removeChild(this); |
| 2645 else | 2645 } else { |
| 2646 this.updateTitle(); | 2646 this.updateTitle(); |
| 2647 } |
| 2647 }, | 2648 }, |
| 2648 | 2649 |
| 2649 /** | 2650 /** |
| 2650 * @param {string} moveDirection | 2651 * @param {string} moveDirection |
| 2651 * @return {?WebInspector.StylePropertyTreeElement} | 2652 * @return {?WebInspector.StylePropertyTreeElement} |
| 2652 */ | 2653 */ |
| 2653 _findSibling: function(moveDirection) | 2654 _findSibling: function(moveDirection) |
| 2654 { | 2655 { |
| 2655 var target = this; | 2656 var target = this; |
| 2656 do { | 2657 do { |
| (...skipping 593 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3250 | 3251 |
| 3251 /** | 3252 /** |
| 3252 * @override | 3253 * @override |
| 3253 * @return {?WebInspector.ToolbarItem} | 3254 * @return {?WebInspector.ToolbarItem} |
| 3254 */ | 3255 */ |
| 3255 item: function() | 3256 item: function() |
| 3256 { | 3257 { |
| 3257 return this._button; | 3258 return this._button; |
| 3258 } | 3259 } |
| 3259 } | 3260 } |
| OLD | NEW |