| 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 620 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 631 | 631 |
| 632 createIcon() { | 632 createIcon() { |
| 633 if (!this._iconElement) { | 633 if (!this._iconElement) { |
| 634 this._iconElement = createElementWithClass('div', 'icon'); | 634 this._iconElement = createElementWithClass('div', 'icon'); |
| 635 this._listItemNode.insertBefore(this._iconElement, this._listItemNode.firs
tChild); | 635 this._listItemNode.insertBefore(this._iconElement, this._listItemNode.firs
tChild); |
| 636 this._ensureSelection(); | 636 this._ensureSelection(); |
| 637 } | 637 } |
| 638 } | 638 } |
| 639 | 639 |
| 640 /** | 640 /** |
| 641 * @param {!Array<!UI.Icon>} icons | 641 * @param {!Array<!Element>} icons |
| 642 */ | 642 */ |
| 643 setLeadingIcons(icons) { | 643 setLeadingIcons(icons) { |
| 644 if (!this._leadingIconsElement && !icons.length) | 644 if (!this._leadingIconsElement && !icons.length) |
| 645 return; | 645 return; |
| 646 if (!this._leadingIconsElement) { | 646 if (!this._leadingIconsElement) { |
| 647 this._leadingIconsElement = createElementWithClass('div', 'leading-icons')
; | 647 this._leadingIconsElement = createElementWithClass('div', 'leading-icons')
; |
| 648 this._leadingIconsElement.classList.add('icons-container'); | 648 this._leadingIconsElement.classList.add('icons-container'); |
| 649 this._listItemNode.insertBefore(this._leadingIconsElement, this._titleElem
ent); | 649 this._listItemNode.insertBefore(this._leadingIconsElement, this._titleElem
ent); |
| 650 this._ensureSelection(); | 650 this._ensureSelection(); |
| 651 } | 651 } |
| 652 this._leadingIconsElement.removeChildren(); | 652 this._leadingIconsElement.removeChildren(); |
| 653 for (var icon of icons) | 653 for (var icon of icons) |
| 654 this._leadingIconsElement.appendChild(icon); | 654 this._leadingIconsElement.appendChild(icon); |
| 655 } | 655 } |
| 656 | 656 |
| 657 /** | 657 /** |
| 658 * @param {!Array<!UI.Icon>} icons | 658 * @param {!Array<!Element>} icons |
| 659 */ | 659 */ |
| 660 setTrailingIcons(icons) { | 660 setTrailingIcons(icons) { |
| 661 if (!this._trailingIconsElement && !icons.length) | 661 if (!this._trailingIconsElement && !icons.length) |
| 662 return; | 662 return; |
| 663 if (!this._trailingIconsElement) { | 663 if (!this._trailingIconsElement) { |
| 664 this._trailingIconsElement = createElementWithClass('div', 'trailing-icons
'); | 664 this._trailingIconsElement = createElementWithClass('div', 'trailing-icons
'); |
| 665 this._trailingIconsElement.classList.add('icons-container'); | 665 this._trailingIconsElement.classList.add('icons-container'); |
| 666 this._listItemNode.appendChild(this._trailingIconsElement); | 666 this._listItemNode.appendChild(this._trailingIconsElement); |
| 667 this._ensureSelection(); | 667 this._ensureSelection(); |
| 668 } | 668 } |
| (...skipping 508 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1177 var paddingLeftValue = window.getComputedStyle(this._listItemNode).paddingLe
ft; | 1177 var paddingLeftValue = window.getComputedStyle(this._listItemNode).paddingLe
ft; |
| 1178 console.assert(paddingLeftValue.endsWith('px')); | 1178 console.assert(paddingLeftValue.endsWith('px')); |
| 1179 var computedLeftPadding = parseFloat(paddingLeftValue); | 1179 var computedLeftPadding = parseFloat(paddingLeftValue); |
| 1180 var left = this._listItemNode.totalOffsetLeft() + computedLeftPadding; | 1180 var left = this._listItemNode.totalOffsetLeft() + computedLeftPadding; |
| 1181 return event.pageX >= left && event.pageX <= left + TreeElement._ArrowToggle
Width && this._expandable; | 1181 return event.pageX >= left && event.pageX <= left + TreeElement._ArrowToggle
Width && this._expandable; |
| 1182 } | 1182 } |
| 1183 }; | 1183 }; |
| 1184 | 1184 |
| 1185 /** @const */ | 1185 /** @const */ |
| 1186 TreeElement._ArrowToggleWidth = 10; | 1186 TreeElement._ArrowToggleWidth = 10; |
| OLD | NEW |