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 691 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
702 _treeElementToggled(event) { | 702 _treeElementToggled(event) { |
703 var element = event.currentTarget; | 703 var element = event.currentTarget; |
704 if (element.treeElement !== this || element.hasSelection()) | 704 if (element.treeElement !== this || element.hasSelection()) |
705 return; | 705 return; |
706 | 706 |
707 var toggleOnClick = this.toggleOnClick && !this.selectable; | 707 var toggleOnClick = this.toggleOnClick && !this.selectable; |
708 var isInTriangle = this.isEventWithinDisclosureTriangle(event); | 708 var isInTriangle = this.isEventWithinDisclosureTriangle(event); |
709 if (!toggleOnClick && !isInTriangle) | 709 if (!toggleOnClick && !isInTriangle) |
710 return; | 710 return; |
711 | 711 |
712 if (event.target && event.target.enclosingNodeOrSelfWithNodeName('a')) | |
713 return; | |
714 | |
715 if (this.expanded) { | 712 if (this.expanded) { |
716 if (event.altKey) | 713 if (event.altKey) |
717 this.collapseRecursively(); | 714 this.collapseRecursively(); |
718 else | 715 else |
719 this.collapse(); | 716 this.collapse(); |
720 } else { | 717 } else { |
721 if (event.altKey) | 718 if (event.altKey) |
722 this.expandRecursively(); | 719 this.expandRecursively(); |
723 else | 720 else |
724 this.expand(); | 721 this.expand(); |
(...skipping 389 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1114 var paddingLeftValue = window.getComputedStyle(this._listItemNode).paddingLe
ft; | 1111 var paddingLeftValue = window.getComputedStyle(this._listItemNode).paddingLe
ft; |
1115 console.assert(paddingLeftValue.endsWith('px')); | 1112 console.assert(paddingLeftValue.endsWith('px')); |
1116 var computedLeftPadding = parseFloat(paddingLeftValue); | 1113 var computedLeftPadding = parseFloat(paddingLeftValue); |
1117 var left = this._listItemNode.totalOffsetLeft() + computedLeftPadding; | 1114 var left = this._listItemNode.totalOffsetLeft() + computedLeftPadding; |
1118 return event.pageX >= left && event.pageX <= left + TreeElement._ArrowToggle
Width && this._expandable; | 1115 return event.pageX >= left && event.pageX <= left + TreeElement._ArrowToggle
Width && this._expandable; |
1119 } | 1116 } |
1120 }; | 1117 }; |
1121 | 1118 |
1122 /** @const */ | 1119 /** @const */ |
1123 TreeElement._ArrowToggleWidth = 10; | 1120 TreeElement._ArrowToggleWidth = 10; |
OLD | NEW |