| 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 1141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1152 _onMouseOut: function(event) | 1152 _onMouseOut: function(event) |
| 1153 { | 1153 { |
| 1154 this.element.classList.remove("hovered"); | 1154 this.element.classList.remove("hovered"); |
| 1155 if (this._record.graphRow()) | 1155 if (this._record.graphRow()) |
| 1156 this._record.graphRow().element.classList.remove("hovered"); | 1156 this._record.graphRow().element.classList.remove("hovered"); |
| 1157 } | 1157 } |
| 1158 } | 1158 } |
| 1159 | 1159 |
| 1160 /** | 1160 /** |
| 1161 * @constructor | 1161 * @constructor |
| 1162 * @param {!Element} graphContainer |
| 1162 * @param {function(!WebInspector.TimelinePresentationModel.Record)} selectRecor
d | 1163 * @param {function(!WebInspector.TimelinePresentationModel.Record)} selectRecor
d |
| 1163 * @param {function()} scheduleRefresh | 1164 * @param {function()} scheduleRefresh |
| 1164 */ | 1165 */ |
| 1165 WebInspector.TimelineRecordGraphRow = function(graphContainer, selectRecord, sch
eduleRefresh) | 1166 WebInspector.TimelineRecordGraphRow = function(graphContainer, selectRecord, sch
eduleRefresh) |
| 1166 { | 1167 { |
| 1167 this.element = document.createElement("div"); | 1168 this.element = document.createElement("div"); |
| 1168 this.element.row = this; | 1169 this.element.row = this; |
| 1169 this.element.addEventListener("mouseover", this._onMouseOver.bind(this), fal
se); | 1170 this.element.addEventListener("mouseover", this._onMouseOver.bind(this), fal
se); |
| 1170 this.element.addEventListener("mouseout", this._onMouseOut.bind(this), false
); | 1171 this.element.addEventListener("mouseout", this._onMouseOut.bind(this), false
); |
| 1171 this.element.addEventListener("click", this._onClick.bind(this), false); | 1172 this.element.addEventListener("click", this._onClick.bind(this), false); |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1272 WebInspector.TimelineExpandableElement = function(container) | 1273 WebInspector.TimelineExpandableElement = function(container) |
| 1273 { | 1274 { |
| 1274 this._element = container.createChild("div", "timeline-expandable"); | 1275 this._element = container.createChild("div", "timeline-expandable"); |
| 1275 this._element.createChild("div", "timeline-expandable-left"); | 1276 this._element.createChild("div", "timeline-expandable-left"); |
| 1276 this._arrow = this._element.createChild("div", "timeline-expandable-arrow"); | 1277 this._arrow = this._element.createChild("div", "timeline-expandable-arrow"); |
| 1277 } | 1278 } |
| 1278 | 1279 |
| 1279 WebInspector.TimelineExpandableElement.prototype = { | 1280 WebInspector.TimelineExpandableElement.prototype = { |
| 1280 /** | 1281 /** |
| 1281 * @param {!WebInspector.TimelinePresentationModel.Record} record | 1282 * @param {!WebInspector.TimelinePresentationModel.Record} record |
| 1283 * @param {number} index |
| 1284 * @param {number} left |
| 1285 * @param {number} width |
| 1282 */ | 1286 */ |
| 1283 _update: function(record, index, left, width) | 1287 _update: function(record, index, left, width) |
| 1284 { | 1288 { |
| 1285 const rowHeight = WebInspector.TimelinePanel.rowHeight; | 1289 const rowHeight = WebInspector.TimelinePanel.rowHeight; |
| 1286 if (record.visibleChildrenCount() || record.expandable()) { | 1290 if (record.visibleChildrenCount() || record.expandable()) { |
| 1287 this._element.style.top = index * rowHeight + "px"; | 1291 this._element.style.top = index * rowHeight + "px"; |
| 1288 this._element.style.left = left + "px"; | 1292 this._element.style.left = left + "px"; |
| 1289 this._element.style.width = Math.max(12, width + 25) + "px"; | 1293 this._element.style.width = Math.max(12, width + 25) + "px"; |
| 1290 if (!record.collapsed()) { | 1294 if (!record.collapsed()) { |
| 1291 this._element.style.height = (record.visibleChildrenCount() + 1)
* rowHeight + "px"; | 1295 this._element.style.height = (record.visibleChildrenCount() + 1)
* rowHeight + "px"; |
| 1292 this._element.classList.add("timeline-expandable-expanded"); | 1296 this._element.classList.add("timeline-expandable-expanded"); |
| 1293 this._element.classList.remove("timeline-expandable-collapsed"); | 1297 this._element.classList.remove("timeline-expandable-collapsed"); |
| 1294 } else { | 1298 } else { |
| 1295 this._element.style.height = rowHeight + "px"; | 1299 this._element.style.height = rowHeight + "px"; |
| 1296 this._element.classList.add("timeline-expandable-collapsed"); | 1300 this._element.classList.add("timeline-expandable-collapsed"); |
| 1297 this._element.classList.remove("timeline-expandable-expanded"); | 1301 this._element.classList.remove("timeline-expandable-expanded"); |
| 1298 } | 1302 } |
| 1299 this._element.classList.remove("hidden"); | 1303 this._element.classList.remove("hidden"); |
| 1300 } else | 1304 } else |
| 1301 this._element.classList.add("hidden"); | 1305 this._element.classList.add("hidden"); |
| 1302 }, | 1306 }, |
| 1303 | 1307 |
| 1304 _dispose: function() | 1308 _dispose: function() |
| 1305 { | 1309 { |
| 1306 this._element.remove(); | 1310 this._element.remove(); |
| 1307 } | 1311 } |
| 1308 } | 1312 } |
| OLD | NEW |