OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 Google Inc. All rights reserved. |
3 * Copyright (C) 2012 Intel Inc. All rights reserved. | 3 * Copyright (C) 2012 Intel Inc. All rights reserved. |
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 are | 6 * modification, are permitted provided that the following conditions are |
7 * met: | 7 * met: |
8 * | 8 * |
9 * * Redistributions of source code must retain the above copyright | 9 * * 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 486 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
497 var graphRowElement = this._graphRowsElement.firstChild; | 497 var graphRowElement = this._graphRowsElement.firstChild; |
498 var scheduleRefreshCallback = this._invalidateAndScheduleRefresh.bind(th
is, true, true); | 498 var scheduleRefreshCallback = this._invalidateAndScheduleRefresh.bind(th
is, true, true); |
499 var selectRecordCallback = this._selectRecord.bind(this); | 499 var selectRecordCallback = this._selectRecord.bind(this); |
500 this._itemsGraphsElement.removeChild(this._expandElements); | 500 this._itemsGraphsElement.removeChild(this._expandElements); |
501 this._expandElements.removeChildren(); | 501 this._expandElements.removeChildren(); |
502 | 502 |
503 for (var i = 0; i < endIndex; ++i) { | 503 for (var i = 0; i < endIndex; ++i) { |
504 var record = recordsInWindow[i]; | 504 var record = recordsInWindow[i]; |
505 | 505 |
506 if (i < startIndex) { | 506 if (i < startIndex) { |
507 var lastChildIndex = i + record.visibleChildrenCount; | 507 var lastChildIndex = i + record.visibleChildrenCount(); |
508 if (lastChildIndex >= startIndex && lastChildIndex < endIndex) { | 508 if (lastChildIndex >= startIndex && lastChildIndex < endIndex) { |
509 var expandElement = new WebInspector.TimelineExpandableEleme
nt(this._expandElements); | 509 var expandElement = new WebInspector.TimelineExpandableEleme
nt(this._expandElements); |
510 var positions = this._calculator.computeBarGraphWindowPositi
on(record); | 510 var positions = this._calculator.computeBarGraphWindowPositi
on(record); |
511 expandElement._update(record, i, positions.left - this._expa
ndOffset, positions.width); | 511 expandElement._update(record, i, positions.left - this._expa
ndOffset, positions.width); |
512 } | 512 } |
513 } else { | 513 } else { |
514 if (!listRowElement) { | 514 if (!listRowElement) { |
515 listRowElement = new WebInspector.TimelineRecordListRow(this
._linkifier, selectRecordCallback, scheduleRefreshCallback).element; | 515 listRowElement = new WebInspector.TimelineRecordListRow(this
._linkifier, selectRecordCallback, scheduleRefreshCallback).element; |
516 this._sidebarListElement.appendChild(listRowElement); | 516 this._sidebarListElement.appendChild(listRowElement); |
517 } | 517 } |
(...skipping 706 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1224 this._arrow = this._element.createChild("div", "timeline-expandable-arrow"); | 1224 this._arrow = this._element.createChild("div", "timeline-expandable-arrow"); |
1225 } | 1225 } |
1226 | 1226 |
1227 WebInspector.TimelineExpandableElement.prototype = { | 1227 WebInspector.TimelineExpandableElement.prototype = { |
1228 /** | 1228 /** |
1229 * @param {!WebInspector.TimelinePresentationModel.Record} record | 1229 * @param {!WebInspector.TimelinePresentationModel.Record} record |
1230 */ | 1230 */ |
1231 _update: function(record, index, left, width) | 1231 _update: function(record, index, left, width) |
1232 { | 1232 { |
1233 const rowHeight = WebInspector.TimelinePanel.rowHeight; | 1233 const rowHeight = WebInspector.TimelinePanel.rowHeight; |
1234 if (record.visibleChildrenCount || record.expandable) { | 1234 if (record.visibleChildrenCount() || record.expandable()) { |
1235 this._element.style.top = index * rowHeight + "px"; | 1235 this._element.style.top = index * rowHeight + "px"; |
1236 this._element.style.left = left + "px"; | 1236 this._element.style.left = left + "px"; |
1237 this._element.style.width = Math.max(12, width + 25) + "px"; | 1237 this._element.style.width = Math.max(12, width + 25) + "px"; |
1238 if (!record.collapsed()) { | 1238 if (!record.collapsed()) { |
1239 this._element.style.height = (record.visibleChildrenCount + 1) *
rowHeight + "px"; | 1239 this._element.style.height = (record.visibleChildrenCount() + 1)
* rowHeight + "px"; |
1240 this._element.classList.add("timeline-expandable-expanded"); | 1240 this._element.classList.add("timeline-expandable-expanded"); |
1241 this._element.classList.remove("timeline-expandable-collapsed"); | 1241 this._element.classList.remove("timeline-expandable-collapsed"); |
1242 } else { | 1242 } else { |
1243 this._element.style.height = rowHeight + "px"; | 1243 this._element.style.height = rowHeight + "px"; |
1244 this._element.classList.add("timeline-expandable-collapsed"); | 1244 this._element.classList.add("timeline-expandable-collapsed"); |
1245 this._element.classList.remove("timeline-expandable-expanded"); | 1245 this._element.classList.remove("timeline-expandable-expanded"); |
1246 } | 1246 } |
1247 this._element.classList.remove("hidden"); | 1247 this._element.classList.remove("hidden"); |
1248 } else | 1248 } else |
1249 this._element.classList.add("hidden"); | 1249 this._element.classList.add("hidden"); |
1250 }, | 1250 }, |
1251 | 1251 |
1252 _dispose: function() | 1252 _dispose: function() |
1253 { | 1253 { |
1254 this._element.remove(); | 1254 this._element.remove(); |
1255 } | 1255 } |
1256 } | 1256 } |
OLD | NEW |