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 17 matching lines...) Expand all Loading... |
28 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 28 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
29 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 29 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
30 */ | 30 */ |
31 | 31 |
32 /** | 32 /** |
33 * @constructor | 33 * @constructor |
34 * @extends {WebInspector.View} | 34 * @extends {WebInspector.View} |
35 * @implements {WebInspector.TimelineModeView} | 35 * @implements {WebInspector.TimelineModeView} |
36 * @param {!WebInspector.TimelineModeViewDelegate} delegate | 36 * @param {!WebInspector.TimelineModeViewDelegate} delegate |
37 * @param {!WebInspector.TimelineModel} model | 37 * @param {!WebInspector.TimelineModel} model |
38 * @param {!WebInspector.TimelinePresentationModel} presentationModel | |
39 * @param {?WebInspector.TimelineFrameModel} frameModel | |
40 */ | 38 */ |
41 WebInspector.TimelineView = function(delegate, model, presentationModel, frameMo
del) | 39 WebInspector.TimelineView = function(delegate, model) |
42 { | 40 { |
43 WebInspector.View.call(this); | 41 WebInspector.View.call(this); |
44 this.element.classList.add("timeline-view"); | 42 this.element.classList.add("timeline-view"); |
45 this.element.classList.add("hbox"); | 43 this.element.classList.add("hbox"); |
46 | 44 |
47 this._delegate = delegate; | 45 this._delegate = delegate; |
48 this._model = model; | 46 this._model = model; |
49 this._presentationModel = presentationModel; | 47 this._presentationModel = new WebInspector.TimelinePresentationModel(model); |
50 this._frameModel = frameModel; | |
51 this._calculator = new WebInspector.TimelineCalculator(model); | 48 this._calculator = new WebInspector.TimelineCalculator(model); |
52 this._linkifier = new WebInspector.Linkifier(); | 49 this._linkifier = new WebInspector.Linkifier(); |
53 | 50 |
54 this._boundariesAreValid = true; | 51 this._boundariesAreValid = true; |
55 this._scrollTop = 0; | 52 this._scrollTop = 0; |
56 | 53 |
57 this._recordsView = this._createRecordsView(); | 54 this._recordsView = this._createRecordsView(); |
58 this._recordsView.addEventListener(WebInspector.SplitView.Events.SidebarSize
Changed, this._sidebarResized, this); | 55 this._recordsView.addEventListener(WebInspector.SplitView.Events.SidebarSize
Changed, this._sidebarResized, this); |
59 this._recordsView.show(this.element); | 56 this._recordsView.show(this.element); |
60 this.element.appendChild(this._timelineGrid.gridHeaderElement); | 57 this.element.appendChild(this._timelineGrid.gridHeaderElement); |
61 | 58 |
62 this._popoverHelper = new WebInspector.PopoverHelper(this.element, this._get
PopoverAnchor.bind(this), this._showPopover.bind(this)); | 59 this._popoverHelper = new WebInspector.PopoverHelper(this.element, this._get
PopoverAnchor.bind(this), this._showPopover.bind(this)); |
63 | 60 |
64 this.element.addEventListener("mousemove", this._mouseMove.bind(this), false
); | 61 this.element.addEventListener("mousemove", this._mouseMove.bind(this), false
); |
65 this.element.addEventListener("mouseout", this._mouseOut.bind(this), false); | 62 this.element.addEventListener("mouseout", this._mouseOut.bind(this), false); |
66 this.element.addEventListener("keydown", this._keyDown.bind(this), false); | 63 this.element.addEventListener("keydown", this._keyDown.bind(this), false); |
67 | 64 |
68 this._expandOffset = 15; | 65 this._expandOffset = 15; |
69 } | 66 } |
70 | 67 |
71 WebInspector.TimelineView.prototype = { | 68 WebInspector.TimelineView.prototype = { |
72 /** | 69 /** |
| 70 * @param {?WebInspector.TimelineFrameModel} frameModel |
| 71 */ |
| 72 setFrameModel: function(frameModel) |
| 73 { |
| 74 this._frameModel = frameModel; |
| 75 }, |
| 76 |
| 77 /** |
73 * @return {!WebInspector.SplitView} | 78 * @return {!WebInspector.SplitView} |
74 */ | 79 */ |
75 _createRecordsView: function() | 80 _createRecordsView: function() |
76 { | 81 { |
77 var recordsView = new WebInspector.SplitView(true, false, "timelinePanel
RecorsSplitViewState"); | 82 var recordsView = new WebInspector.SplitView(true, false, "timelinePanel
RecorsSplitViewState"); |
78 this._containerElement = recordsView.element; | 83 this._containerElement = recordsView.element; |
79 this._containerElement.tabIndex = 0; | 84 this._containerElement.tabIndex = 0; |
80 this._containerElement.id = "timeline-container"; | 85 this._containerElement.id = "timeline-container"; |
81 this._containerElement.addEventListener("scroll", this._onScroll.bind(th
is), false); | 86 this._containerElement.addEventListener("scroll", this._onScroll.bind(th
is), false); |
82 | 87 |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
114 _rootRecord: function() | 119 _rootRecord: function() |
115 { | 120 { |
116 return this._presentationModel.rootRecord(); | 121 return this._presentationModel.rootRecord(); |
117 }, | 122 }, |
118 | 123 |
119 _updateEventDividers: function() | 124 _updateEventDividers: function() |
120 { | 125 { |
121 this._timelineGrid.removeEventDividers(); | 126 this._timelineGrid.removeEventDividers(); |
122 var clientWidth = this._graphRowsElementWidth; | 127 var clientWidth = this._graphRowsElementWidth; |
123 var dividers = []; | 128 var dividers = []; |
124 var eventDividerRecords = this._presentationModel.eventDividerRecords(); | 129 var eventDividerRecords = this._model.eventDividerRecords(); |
125 | 130 |
126 for (var i = 0; i < eventDividerRecords.length; ++i) { | 131 for (var i = 0; i < eventDividerRecords.length; ++i) { |
127 var record = eventDividerRecords[i]; | 132 var record = eventDividerRecords[i]; |
128 var positions = this._calculator.computeBarGraphWindowPosition(recor
d); | 133 var positions = this._calculator.computeBarGraphWindowPosition(recor
d); |
129 var dividerPosition = Math.round(positions.left); | 134 var dividerPosition = Math.round(positions.left); |
130 if (dividerPosition < 0 || dividerPosition >= clientWidth || divider
s[dividerPosition]) | 135 if (dividerPosition < 0 || dividerPosition >= clientWidth || divider
s[dividerPosition]) |
131 continue; | 136 continue; |
132 var divider = WebInspector.TimelineUIUtils.createEventDivider(record
.type, WebInspector.TimelineUIUtils.recordTitle(record)); | 137 var divider = WebInspector.TimelineUIUtils.createEventDivider(record
.type, WebInspector.TimelineUIUtils.recordTitle(record)); |
133 divider.style.left = dividerPosition + "px"; | 138 divider.style.left = dividerPosition + "px"; |
134 dividers[dividerPosition] = divider; | 139 dividers[dividerPosition] = divider; |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
187 if (!frameBar) | 192 if (!frameBar) |
188 return; | 193 return; |
189 this._delegate.requestWindowTimes(frameBar._frame.startTime, frameBar._f
rame.endTime); | 194 this._delegate.requestWindowTimes(frameBar._frame.startTime, frameBar._f
rame.endTime); |
190 }, | 195 }, |
191 | 196 |
192 /** | 197 /** |
193 * @param {!WebInspector.TimelineModel.Record} record | 198 * @param {!WebInspector.TimelineModel.Record} record |
194 */ | 199 */ |
195 addRecord: function(record) | 200 addRecord: function(record) |
196 { | 201 { |
197 if (this._innerAddRecordToTimeline(record)) | 202 this._presentationModel.addRecord(record); |
198 this._invalidateAndScheduleRefresh(false, false); | 203 this._invalidateAndScheduleRefresh(false, false); |
199 }, | 204 }, |
200 | 205 |
201 /** | 206 /** |
202 * @param {!WebInspector.TimelineModel.Record} record | |
203 * @return {boolean} | |
204 */ | |
205 _innerAddRecordToTimeline: function(record) | |
206 { | |
207 if (record.type === WebInspector.TimelineModel.RecordType.GPUTask) | |
208 return record.startTime < this._windowEndTime; | |
209 | |
210 var hasVisibleRecords = false; | |
211 var presentationModel = this._presentationModel; | |
212 function checkVisible(record) | |
213 { | |
214 hasVisibleRecords |= presentationModel.isVisible(record); | |
215 } | |
216 WebInspector.TimelineModel.forAllRecords([record], checkVisible); | |
217 return hasVisibleRecords; | |
218 }, | |
219 | |
220 /** | |
221 * @param {number} width | 207 * @param {number} width |
222 */ | 208 */ |
223 setSidebarSize: function(width) | 209 setSidebarSize: function(width) |
224 { | 210 { |
225 this._recordsView.setSidebarSize(width); | 211 this._recordsView.setSidebarSize(width); |
226 }, | 212 }, |
227 | 213 |
228 /** | 214 /** |
229 * @param {!WebInspector.Event} event | 215 * @param {!WebInspector.Event} event |
230 */ | 216 */ |
(...skipping 22 matching lines...) Expand all Loading... |
253 | 239 |
254 _resetView: function() | 240 _resetView: function() |
255 { | 241 { |
256 this._windowStartTime = -1; | 242 this._windowStartTime = -1; |
257 this._windowEndTime = -1; | 243 this._windowEndTime = -1; |
258 this._boundariesAreValid = false; | 244 this._boundariesAreValid = false; |
259 this._adjustScrollPosition(0); | 245 this._adjustScrollPosition(0); |
260 this._linkifier.reset(); | 246 this._linkifier.reset(); |
261 this._closeRecordDetails(); | 247 this._closeRecordDetails(); |
262 this._automaticallySizeWindow = true; | 248 this._automaticallySizeWindow = true; |
| 249 this._presentationModel.reset(); |
263 }, | 250 }, |
264 | 251 |
265 reset: function() | 252 reset: function() |
266 { | 253 { |
267 this._resetView(); | 254 this._resetView(); |
268 this._invalidateAndScheduleRefresh(true, true); | 255 this._invalidateAndScheduleRefresh(true, true); |
269 }, | 256 }, |
270 | 257 |
271 /** | 258 /** |
272 * @return {!Array.<!Element>} | 259 * @return {!Array.<!Element>} |
273 */ | 260 */ |
274 elementsToRestoreScrollPositionsFor: function() | 261 elementsToRestoreScrollPositionsFor: function() |
275 { | 262 { |
276 return [this._containerElement]; | 263 return [this._containerElement]; |
277 }, | 264 }, |
278 | 265 |
279 refreshRecords: function() | 266 /** |
| 267 * @param {?RegExp} textFilter |
| 268 */ |
| 269 refreshRecords: function(textFilter) |
280 { | 270 { |
281 this._automaticallySizeWindow = false; | 271 this._automaticallySizeWindow = false; |
| 272 this._presentationModel.setTextFilter(textFilter); |
282 this._invalidateAndScheduleRefresh(false, true); | 273 this._invalidateAndScheduleRefresh(false, true); |
283 }, | 274 }, |
284 | 275 |
285 wasShown: function() | 276 wasShown: function() |
286 { | 277 { |
287 WebInspector.View.prototype.wasShown.call(this); | 278 WebInspector.View.prototype.wasShown.call(this); |
288 | 279 |
289 if (!WebInspector.TimelinePanel._categoryStylesInitialized) { | 280 if (!WebInspector.TimelinePanel._categoryStylesInitialized) { |
290 WebInspector.TimelinePanel._categoryStylesInitialized = true; | 281 WebInspector.TimelinePanel._categoryStylesInitialized = true; |
291 this._injectCategoryStyles(); | 282 this._injectCategoryStyles(); |
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
486 var headerHeight = WebInspector.TimelinePanel.headerHeight; | 477 var headerHeight = WebInspector.TimelinePanel.headerHeight; |
487 | 478 |
488 // Convert visible area to visible indexes. Always include top-level rec
ord for a visible nested record. | 479 // Convert visible area to visible indexes. Always include top-level rec
ord for a visible nested record. |
489 var startIndex = Math.max(0, Math.min(Math.floor((visibleTop - headerHei
ght) / rowHeight), recordsInWindow.length - 1)); | 480 var startIndex = Math.max(0, Math.min(Math.floor((visibleTop - headerHei
ght) / rowHeight), recordsInWindow.length - 1)); |
490 var endIndex = Math.min(recordsInWindow.length, Math.ceil(visibleBottom
/ rowHeight)); | 481 var endIndex = Math.min(recordsInWindow.length, Math.ceil(visibleBottom
/ rowHeight)); |
491 var lastVisibleLine = Math.max(0, Math.floor((visibleBottom - headerHeig
ht) / rowHeight)); | 482 var lastVisibleLine = Math.max(0, Math.floor((visibleBottom - headerHeig
ht) / rowHeight)); |
492 if (this._automaticallySizeWindow && recordsInWindow.length > lastVisibl
eLine) { | 483 if (this._automaticallySizeWindow && recordsInWindow.length > lastVisibl
eLine) { |
493 this._automaticallySizeWindow = false; | 484 this._automaticallySizeWindow = false; |
494 this._selectRecord(null); | 485 this._selectRecord(null); |
495 // If we're at the top, always use real timeline start as a left win
dow bound so that expansion arrow padding logic works. | 486 // If we're at the top, always use real timeline start as a left win
dow bound so that expansion arrow padding logic works. |
496 var windowStartTime = startIndex ? recordsInWindow[startIndex].recor
d().startTime : this._presentationModel.minimumRecordTime(); | 487 var windowStartTime = startIndex ? recordsInWindow[startIndex].recor
d().startTime : this._model.minimumRecordTime(); |
497 var windowEndTime = recordsInWindow[Math.max(0, lastVisibleLine - 1)
].record().endTime; | 488 var windowEndTime = recordsInWindow[Math.max(0, lastVisibleLine - 1)
].record().endTime; |
498 this._delegate.requestWindowTimes(windowStartTime, windowEndTime); | 489 this._delegate.requestWindowTimes(windowStartTime, windowEndTime); |
499 recordsInWindow = this._presentationModel.filteredRecords(); | 490 recordsInWindow = this._presentationModel.filteredRecords(); |
500 endIndex = Math.min(recordsInWindow.length, lastVisibleLine); | 491 endIndex = Math.min(recordsInWindow.length, lastVisibleLine); |
501 } | 492 } |
502 | 493 |
503 // Resize gaps first. | 494 // Resize gaps first. |
504 this._topGapElement.style.height = (startIndex * rowHeight) + "px"; | 495 this._topGapElement.style.height = (startIndex * rowHeight) + "px"; |
505 this._recordsView.sidebarElement().firstElementChild.style.flexBasis = (
startIndex * rowHeight + headerHeight) + "px"; | 496 this._recordsView.sidebarElement().firstElementChild.style.flexBasis = (
startIndex * rowHeight + headerHeight) + "px"; |
506 this._bottomGapElement.style.height = (recordsInWindow.length - endIndex
) * rowHeight + "px"; | 497 this._bottomGapElement.style.height = (recordsInWindow.length - endIndex
) * rowHeight + "px"; |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
567 | 558 |
568 this._itemsGraphsElement.insertBefore(this._graphRowsElement, this._bott
omGapElement); | 559 this._itemsGraphsElement.insertBefore(this._graphRowsElement, this._bott
omGapElement); |
569 this._itemsGraphsElement.appendChild(this._expandElements); | 560 this._itemsGraphsElement.appendChild(this._expandElements); |
570 this._adjustScrollPosition(recordsInWindow.length * rowHeight + headerHe
ight); | 561 this._adjustScrollPosition(recordsInWindow.length * rowHeight + headerHe
ight); |
571 | 562 |
572 return recordsInWindow.length; | 563 return recordsInWindow.length; |
573 }, | 564 }, |
574 | 565 |
575 _refreshAllUtilizationBars: function() | 566 _refreshAllUtilizationBars: function() |
576 { | 567 { |
577 this._refreshUtilizationBars(WebInspector.UIString("CPU"), this._present
ationModel.mainThreadTasks(), this._cpuBarsElement); | 568 this._refreshUtilizationBars(WebInspector.UIString("CPU"), this._model.m
ainThreadTasks(), this._cpuBarsElement); |
578 if (WebInspector.experimentsSettings.gpuTimeline.isEnabled()) | 569 if (WebInspector.experimentsSettings.gpuTimeline.isEnabled()) |
579 this._refreshUtilizationBars(WebInspector.UIString("GPU"), this._pre
sentationModel.gpuThreadTasks(), this._gpuBarsElement); | 570 this._refreshUtilizationBars(WebInspector.UIString("GPU"), this._mod
el.gpuThreadTasks(), this._gpuBarsElement); |
580 }, | 571 }, |
581 | 572 |
582 /** | 573 /** |
583 * @param {string} name | 574 * @param {string} name |
584 * @param {!Array.<!WebInspector.TimelineModel.Record>} tasks | 575 * @param {!Array.<!WebInspector.TimelineModel.Record>} tasks |
585 * @param {?Element} container | 576 * @param {?Element} container |
586 */ | 577 */ |
587 _refreshUtilizationBars: function(name, tasks, container) | 578 _refreshUtilizationBars: function(name, tasks, container) |
588 { | 579 { |
589 if (!container) | 580 if (!container) |
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
718 if (index === -1) | 709 if (index === -1) |
719 index = 0; | 710 index = 0; |
720 | 711 |
721 switch (event.keyIdentifier) { | 712 switch (event.keyIdentifier) { |
722 case "Left": | 713 case "Left": |
723 if (record.presentationParent()) { | 714 if (record.presentationParent()) { |
724 if ((!record.expandable() || record.collapsed()) && record.prese
ntationParent() !== this._presentationModel.rootRecord()) { | 715 if ((!record.expandable() || record.collapsed()) && record.prese
ntationParent() !== this._presentationModel.rootRecord()) { |
725 this._selectRecord(record.presentationParent()); | 716 this._selectRecord(record.presentationParent()); |
726 } else { | 717 } else { |
727 record.setCollapsed(true); | 718 record.setCollapsed(true); |
728 record.clicked = true; | |
729 this._invalidateAndScheduleRefresh(true, true); | 719 this._invalidateAndScheduleRefresh(true, true); |
730 } | 720 } |
731 } | 721 } |
732 event.consume(true); | 722 event.consume(true); |
733 break; | 723 break; |
734 case "Up": | 724 case "Up": |
735 if (--index < 0) | 725 if (--index < 0) |
736 break; | 726 break; |
737 this._selectRecord(recordsInWindow[index]); | 727 this._selectRecord(recordsInWindow[index]); |
738 event.consume(true); | 728 event.consume(true); |
739 break; | 729 break; |
740 case "Right": | 730 case "Right": |
741 if (record.expandable() && record.collapsed()) { | 731 if (record.expandable() && record.collapsed()) { |
742 record.setCollapsed(false); | 732 record.setCollapsed(false); |
743 record.clicked = true; | |
744 this._invalidateAndScheduleRefresh(true, true); | 733 this._invalidateAndScheduleRefresh(true, true); |
745 } else { | 734 } else { |
746 if (++index >= recordsInWindow.length) | 735 if (++index >= recordsInWindow.length) |
747 break; | 736 break; |
748 this._selectRecord(recordsInWindow[index]); | 737 this._selectRecord(recordsInWindow[index]); |
749 } | 738 } |
750 event.consume(true); | 739 event.consume(true); |
751 break; | 740 break; |
752 case "Down": | 741 case "Down": |
753 if (++index >= recordsInWindow.length) | 742 if (++index >= recordsInWindow.length) |
(...skipping 293 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1047 } else { | 1036 } else { |
1048 var detailsNode = WebInspector.TimelineUIUtils.buildDetailsNode(reco
rd, this._linkifier); | 1037 var detailsNode = WebInspector.TimelineUIUtils.buildDetailsNode(reco
rd, this._linkifier); |
1049 if (detailsNode) { | 1038 if (detailsNode) { |
1050 this._dataElement.appendChild(document.createTextNode("(")); | 1039 this._dataElement.appendChild(document.createTextNode("(")); |
1051 this._dataElement.appendChild(detailsNode); | 1040 this._dataElement.appendChild(detailsNode); |
1052 this._dataElement.appendChild(document.createTextNode(")")); | 1041 this._dataElement.appendChild(document.createTextNode(")")); |
1053 } | 1042 } |
1054 } | 1043 } |
1055 | 1044 |
1056 this._expandArrowElement.enableStyleClass("parent", presentationRecord.h
asPresentationChildren()); | 1045 this._expandArrowElement.enableStyleClass("parent", presentationRecord.h
asPresentationChildren()); |
1057 this._expandArrowElement.enableStyleClass("expanded", presentationRecord
.visibleChildrenCount()); | 1046 this._expandArrowElement.enableStyleClass("expanded", !!presentationReco
rd.visibleChildrenCount()); |
1058 this._record.setListRow(this); | 1047 this._record.setListRow(this); |
1059 }, | 1048 }, |
1060 | 1049 |
1061 highlight: function(regExp, domChanges) | 1050 highlight: function(regExp, domChanges) |
1062 { | 1051 { |
1063 var matchInfo = this.element.textContent.match(regExp); | 1052 var matchInfo = this.element.textContent.match(regExp); |
1064 if (matchInfo) | 1053 if (matchInfo) |
1065 WebInspector.highlightSearchResult(this.element, matchInfo.index, ma
tchInfo[0].length, domChanges); | 1054 WebInspector.highlightSearchResult(this.element, matchInfo.index, ma
tchInfo[0].length, domChanges); |
1066 }, | 1055 }, |
1067 | 1056 |
1068 dispose: function() | 1057 dispose: function() |
1069 { | 1058 { |
1070 this.element.remove(); | 1059 this.element.remove(); |
1071 }, | 1060 }, |
1072 | 1061 |
1073 /** | 1062 /** |
1074 * @param {!Event} event | 1063 * @param {!Event} event |
1075 */ | 1064 */ |
1076 _onExpandClick: function(event) | 1065 _onExpandClick: function(event) |
1077 { | 1066 { |
1078 this._record.setCollapsed(!this._record.collapsed()); | 1067 this._record.setCollapsed(!this._record.collapsed()); |
1079 this._record.clicked = true; | |
1080 this._scheduleRefresh(); | 1068 this._scheduleRefresh(); |
1081 event.consume(true); | 1069 event.consume(true); |
1082 }, | 1070 }, |
1083 | 1071 |
1084 /** | 1072 /** |
1085 * @param {?Event} event | 1073 * @param {?Event} event |
1086 */ | 1074 */ |
1087 _onClick: function(event) | 1075 _onClick: function(event) |
1088 { | 1076 { |
1089 this._selectRecord(this._record); | 1077 this._selectRecord(this._record); |
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1197 * @param {boolean} selected | 1185 * @param {boolean} selected |
1198 */ | 1186 */ |
1199 renderAsSelected: function(selected) | 1187 renderAsSelected: function(selected) |
1200 { | 1188 { |
1201 this.element.enableStyleClass("selected", selected); | 1189 this.element.enableStyleClass("selected", selected); |
1202 }, | 1190 }, |
1203 | 1191 |
1204 _expand: function() | 1192 _expand: function() |
1205 { | 1193 { |
1206 this._record.setCollapsed(!this._record.collapsed()); | 1194 this._record.setCollapsed(!this._record.collapsed()); |
1207 this._record.clicked = true; | |
1208 this._scheduleRefresh(); | 1195 this._scheduleRefresh(); |
1209 }, | 1196 }, |
1210 | 1197 |
1211 /** | 1198 /** |
1212 * @param {?Event} event | 1199 * @param {?Event} event |
1213 */ | 1200 */ |
1214 _onMouseOver: function(event) | 1201 _onMouseOver: function(event) |
1215 { | 1202 { |
1216 this.element.classList.add("hovered"); | 1203 this.element.classList.add("hovered"); |
1217 if (this._record.listRow()) | 1204 if (this._record.listRow()) |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1268 this._element.classList.remove("hidden"); | 1255 this._element.classList.remove("hidden"); |
1269 } else | 1256 } else |
1270 this._element.classList.add("hidden"); | 1257 this._element.classList.add("hidden"); |
1271 }, | 1258 }, |
1272 | 1259 |
1273 _dispose: function() | 1260 _dispose: function() |
1274 { | 1261 { |
1275 this._element.remove(); | 1262 this._element.remove(); |
1276 } | 1263 } |
1277 } | 1264 } |
OLD | NEW |