| OLD | NEW |
| 1 /** | 1 /** |
| 2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 Google 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 are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * 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 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 1106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1117 currentOffset += nextLevel ? 0 : style.padding; | 1117 currentOffset += nextLevel ? 0 : style.padding; |
| 1118 this._groupOffsets[groupIndex] = currentOffset; | 1118 this._groupOffsets[groupIndex] = currentOffset; |
| 1119 if (parentGroupIsVisible && !style.shareHeaderLine) | 1119 if (parentGroupIsVisible && !style.shareHeaderLine) |
| 1120 currentOffset += style.height; | 1120 currentOffset += style.height; |
| 1121 } | 1121 } |
| 1122 var isFirstOnLevel = groupIndex >= 0 && level === groups[groupIndex].start
Level; | 1122 var isFirstOnLevel = groupIndex >= 0 && level === groups[groupIndex].start
Level; |
| 1123 var thisLevelIsVisible = visible || isFirstOnLevel && groups[groupIndex].s
tyle.useFirstLineForOverview; | 1123 var thisLevelIsVisible = visible || isFirstOnLevel && groups[groupIndex].s
tyle.useFirstLineForOverview; |
| 1124 if (level < levelCount) { | 1124 if (level < levelCount) { |
| 1125 var height; | 1125 var height; |
| 1126 if (groupIndex >= 0) { | 1126 if (groupIndex >= 0) { |
| 1127 var style = groups[groupIndex].style; | 1127 var group = groups[groupIndex]; |
| 1128 height = isFirstOnLevel ? style.height : (style.itemsHeight || this._b
arHeight); | 1128 var style = group.style; |
| 1129 height = isFirstOnLevel && !style.shareHeaderLine || !group.expanded ?
style.height : |
| 1130
(style.itemsHeight || this._barHeight); |
| 1129 } else { | 1131 } else { |
| 1130 height = this._barHeight; | 1132 height = this._barHeight; |
| 1131 } | 1133 } |
| 1132 this._visibleLevels[level] = thisLevelIsVisible; | 1134 this._visibleLevels[level] = thisLevelIsVisible; |
| 1133 this._visibleLevelOffsets[level] = currentOffset; | 1135 this._visibleLevelOffsets[level] = currentOffset; |
| 1134 this._visibleLevelHeights[level] = height; | 1136 this._visibleLevelHeights[level] = height; |
| 1135 } | 1137 } |
| 1136 if (thisLevelIsVisible || (parentGroupIsVisible && style.shareHeaderLine &
& isFirstOnLevel)) | 1138 if (thisLevelIsVisible || (parentGroupIsVisible && style.shareHeaderLine &
& isFirstOnLevel)) |
| 1137 currentOffset += this._visibleLevelHeights[level]; | 1139 currentOffset += this._visibleLevelHeights[level]; |
| 1138 } | 1140 } |
| 1139 if (groupIndex >= 0) | 1141 if (groupIndex >= 0) |
| 1140 this._groupOffsets[groupIndex + 1] = currentOffset; | 1142 this._groupOffsets[groupIndex + 1] = currentOffset; |
| 1141 this._visibleLevelOffsets[level] = currentOffset; | 1143 this._visibleLevelOffsets[level] = currentOffset; |
| 1142 } | 1144 } |
| 1143 | 1145 |
| 1144 /** | 1146 /** |
| 1145 * @param {number} index | 1147 * @param {number} index |
| 1146 */ | 1148 */ |
| 1147 _isGroupCollapsible(index) { | 1149 _isGroupCollapsible(index) { |
| 1148 var groups = this._rawTimelineData.groups || []; | 1150 var groups = this._rawTimelineData.groups || []; |
| 1149 var style = groups[index].style; | 1151 var style = groups[index].style; |
| 1150 if (!style.shareHeaderLine || !style.collapsible) | 1152 if (!style.shareHeaderLine || !style.collapsible) |
| 1151 return !!style.collapsible; | 1153 return !!style.collapsible; |
| 1152 var isLastGroup = index + 1 >= groups.length; | 1154 var isLastGroup = index + 1 >= groups.length; |
| 1153 if (!isLastGroup && groups[index + 1].style.nestingLevel > style.nestingLeve
l) | 1155 if (!isLastGroup && groups[index + 1].style.nestingLevel > style.nestingLeve
l) |
| 1154 return true; | 1156 return true; |
| 1155 var nextGroupLevel = isLastGroup ? this._dataProvider.maxStackDepth() : grou
ps[index + 1].startLevel; | 1157 var nextGroupLevel = isLastGroup ? this._dataProvider.maxStackDepth() : grou
ps[index + 1].startLevel; |
| 1156 // For groups that only have one line and share header line, pretend these a
re not collapsible. | 1158 if (nextGroupLevel !== groups[index].startLevel + 1) |
| 1157 return nextGroupLevel !== groups[index].startLevel + 1; | 1159 return true; |
| 1160 // For groups that only have one line and share header line, pretend these a
re not collapsible |
| 1161 // unless the itemsHeight does not match the headerHeight |
| 1162 return style.height !== style.itemsHeight; |
| 1158 } | 1163 } |
| 1159 | 1164 |
| 1160 /** | 1165 /** |
| 1161 * @param {number} entryIndex | 1166 * @param {number} entryIndex |
| 1162 */ | 1167 */ |
| 1163 setSelectedEntry(entryIndex) { | 1168 setSelectedEntry(entryIndex) { |
| 1164 if (entryIndex === -1 && !this.isDragging()) | 1169 if (entryIndex === -1 && !this.isDragging()) |
| 1165 this.hideRangeSelection(); | 1170 this.hideRangeSelection(); |
| 1166 if (this._selectedEntryIndex === entryIndex) | 1171 if (this._selectedEntryIndex === entryIndex) |
| 1167 return; | 1172 return; |
| (...skipping 455 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1623 } | 1628 } |
| 1624 | 1629 |
| 1625 /** | 1630 /** |
| 1626 * @override | 1631 * @override |
| 1627 * @return {number} | 1632 * @return {number} |
| 1628 */ | 1633 */ |
| 1629 boundarySpan() { | 1634 boundarySpan() { |
| 1630 return this._maximumBoundaries - this._minimumBoundaries; | 1635 return this._maximumBoundaries - this._minimumBoundaries; |
| 1631 } | 1636 } |
| 1632 }; | 1637 }; |
| OLD | NEW |