| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2007 Apple Inc. All rights reserved. | 2 * Copyright (C) 2007 Apple 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 | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * | 7 * |
| 8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. 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 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
| (...skipping 637 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 648 | 648 |
| 649 this._listItemNode.removeChildren(); | 649 this._listItemNode.removeChildren(); |
| 650 if (this._iconElement) | 650 if (this._iconElement) |
| 651 this._listItemNode.appendChild(this._iconElement); | 651 this._listItemNode.appendChild(this._iconElement); |
| 652 | 652 |
| 653 this._listItemNode.appendChild(this._titleElement); | 653 this._listItemNode.appendChild(this._titleElement); |
| 654 this._ensureSelection(); | 654 this._ensureSelection(); |
| 655 }, | 655 }, |
| 656 | 656 |
| 657 /** | 657 /** |
| 658 * @return {string} |
| 659 */ |
| 660 titleAsText: function() |
| 661 { |
| 662 if (!this._title) |
| 663 return ""; |
| 664 if (typeof this._title === "string") |
| 665 return this._title; |
| 666 return this._title.textContent; |
| 667 }, |
| 668 |
| 669 /** |
| 658 * @param {!WebInspector.InplaceEditor.Config} editingConfig | 670 * @param {!WebInspector.InplaceEditor.Config} editingConfig |
| 659 */ | 671 */ |
| 660 startEditingTitle: function(editingConfig) | 672 startEditingTitle: function(editingConfig) |
| 661 { | 673 { |
| 662 WebInspector.InplaceEditor.startEditing(this._titleElement, editingConfi
g); | 674 WebInspector.InplaceEditor.startEditing(this._titleElement, editingConfi
g); |
| 663 this.treeOutline._shadowRoot.getSelection().setBaseAndExtent(this._title
Element, 0, this._titleElement, 1); | 675 this.treeOutline._shadowRoot.getSelection().setBaseAndExtent(this._title
Element, 0, this._titleElement, 1); |
| 664 }, | 676 }, |
| 665 | 677 |
| 666 createIcon() | 678 createIcon() |
| 667 { | 679 { |
| (...skipping 484 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1152 isEventWithinDisclosureTriangle: function(event) | 1164 isEventWithinDisclosureTriangle: function(event) |
| 1153 { | 1165 { |
| 1154 // FIXME: We should not use getComputedStyle(). For that we need to get
rid of using ::before for disclosure triangle. (http://webk.it/74446) | 1166 // FIXME: We should not use getComputedStyle(). For that we need to get
rid of using ::before for disclosure triangle. (http://webk.it/74446) |
| 1155 var paddingLeftValue = window.getComputedStyle(this._listItemNode).paddi
ngLeft; | 1167 var paddingLeftValue = window.getComputedStyle(this._listItemNode).paddi
ngLeft; |
| 1156 console.assert(paddingLeftValue.endsWith("px")); | 1168 console.assert(paddingLeftValue.endsWith("px")); |
| 1157 var computedLeftPadding = parseFloat(paddingLeftValue); | 1169 var computedLeftPadding = parseFloat(paddingLeftValue); |
| 1158 var left = this._listItemNode.totalOffsetLeft() + computedLeftPadding; | 1170 var left = this._listItemNode.totalOffsetLeft() + computedLeftPadding; |
| 1159 return event.pageX >= left && event.pageX <= left + TreeElement._ArrowTo
ggleWidth && this._expandable; | 1171 return event.pageX >= left && event.pageX <= left + TreeElement._ArrowTo
ggleWidth && this._expandable; |
| 1160 } | 1172 } |
| 1161 } | 1173 } |
| OLD | NEW |