| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2007, 2008 Apple Inc. All rights reserved. | 2 * Copyright (C) 2007, 2008 Apple Inc. All rights reserved. |
| 3 * Copyright (C) 2008, 2009 Anthony Ricaud <rik@webkit.org> | 3 * Copyright (C) 2008, 2009 Anthony Ricaud <rik@webkit.org> |
| 4 * Copyright (C) 2009 Google Inc. All rights reserved. | 4 * Copyright (C) 2009 Google Inc. All rights reserved. |
| 5 * | 5 * |
| 6 * Redistribution and use in source and binary forms, with or without | 6 * Redistribution and use in source and binary forms, with or without |
| 7 * modification, are permitted provided that the following conditions | 7 * modification, are permitted provided that the following conditions |
| 8 * are met: | 8 * are met: |
| 9 * | 9 * |
| 10 * 1. Redistributions of source code must retain the above copyright | 10 * 1. Redistributions of source code must retain the above copyright |
| (...skipping 25 matching lines...) Expand all Loading... |
| 36 this.element = createElement("div"); | 36 this.element = createElement("div"); |
| 37 WebInspector.appendStyle(this.element, "ui_lazy/timelineGrid.css"); | 37 WebInspector.appendStyle(this.element, "ui_lazy/timelineGrid.css"); |
| 38 | 38 |
| 39 this._dividersElement = this.element.createChild("div", "resources-dividers"
); | 39 this._dividersElement = this.element.createChild("div", "resources-dividers"
); |
| 40 | 40 |
| 41 this._gridHeaderElement = createElement("div"); | 41 this._gridHeaderElement = createElement("div"); |
| 42 this._gridHeaderElement.classList.add("timeline-grid-header"); | 42 this._gridHeaderElement.classList.add("timeline-grid-header"); |
| 43 this._eventDividersElement = this._gridHeaderElement.createChild("div", "res
ources-event-dividers"); | 43 this._eventDividersElement = this._gridHeaderElement.createChild("div", "res
ources-event-dividers"); |
| 44 this._dividersLabelBarElement = this._gridHeaderElement.createChild("div", "
resources-dividers-label-bar"); | 44 this._dividersLabelBarElement = this._gridHeaderElement.createChild("div", "
resources-dividers-label-bar"); |
| 45 this.element.appendChild(this._gridHeaderElement); | 45 this.element.appendChild(this._gridHeaderElement); |
| 46 | |
| 47 this._leftCurtainElement = this.element.createChild("div", "timeline-curtain
-left"); | |
| 48 this._rightCurtainElement = this.element.createChild("div", "timeline-curtai
n-right"); | |
| 49 } | 46 } |
| 50 | 47 |
| 51 /** | 48 /** |
| 52 * @param {!WebInspector.TimelineGrid.Calculator} calculator | 49 * @param {!WebInspector.TimelineGrid.Calculator} calculator |
| 53 * @param {number=} freeZoneAtLeft | 50 * @param {number=} freeZoneAtLeft |
| 54 * @return {!{offsets: !Array.<number>, precision: number}} | 51 * @return {!{offsets: !Array.<number>, precision: number}} |
| 55 */ | 52 */ |
| 56 WebInspector.TimelineGrid.calculateDividerOffsets = function(calculator, freeZon
eAtLeft) | 53 WebInspector.TimelineGrid.calculateDividerOffsets = function(calculator, freeZon
eAtLeft) |
| 57 { | 54 { |
| 58 /** @const */ var minGridSlicePx = 64; // minimal distance between grid line
s. | 55 /** @const */ var minGridSlicePx = 64; // minimal distance between grid line
s. |
| (...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 264 hideDividers: function() | 261 hideDividers: function() |
| 265 { | 262 { |
| 266 this._dividersElement.classList.add("hidden"); | 263 this._dividersElement.classList.add("hidden"); |
| 267 }, | 264 }, |
| 268 | 265 |
| 269 showDividers: function() | 266 showDividers: function() |
| 270 { | 267 { |
| 271 this._dividersElement.classList.remove("hidden"); | 268 this._dividersElement.classList.remove("hidden"); |
| 272 }, | 269 }, |
| 273 | 270 |
| 274 hideCurtains: function() | |
| 275 { | |
| 276 this._leftCurtainElement.classList.add("hidden"); | |
| 277 this._rightCurtainElement.classList.add("hidden"); | |
| 278 }, | |
| 279 | |
| 280 /** | |
| 281 * @param {number} left | |
| 282 * @param {number} right | |
| 283 */ | |
| 284 showCurtains: function(left, right) | |
| 285 { | |
| 286 this._leftCurtainElement.style.width = (100 * left).toFixed(2) + "%"; | |
| 287 this._leftCurtainElement.classList.remove("hidden"); | |
| 288 this._rightCurtainElement.style.width = (100 * (1 - right)).toFixed(2) +
"%"; | |
| 289 this._rightCurtainElement.classList.remove("hidden"); | |
| 290 }, | |
| 291 | |
| 292 /** | 271 /** |
| 293 * @param {number} scrollTop | 272 * @param {number} scrollTop |
| 294 */ | 273 */ |
| 295 setScrollTop: function(scrollTop) | 274 setScrollTop: function(scrollTop) |
| 296 { | 275 { |
| 297 this._dividersLabelBarElement.style.top = scrollTop + "px"; | 276 this._dividersLabelBarElement.style.top = scrollTop + "px"; |
| 298 this._eventDividersElement.style.top = scrollTop + "px"; | 277 this._eventDividersElement.style.top = scrollTop + "px"; |
| 299 this._leftCurtainElement.style.top = scrollTop + "px"; | |
| 300 this._rightCurtainElement.style.top = scrollTop + "px"; | |
| 301 } | 278 } |
| 302 } | 279 } |
| 303 | 280 |
| 304 /** | 281 /** |
| 305 * @interface | 282 * @interface |
| 306 */ | 283 */ |
| 307 WebInspector.TimelineGrid.Calculator = function() { } | 284 WebInspector.TimelineGrid.Calculator = function() { } |
| 308 | 285 |
| 309 WebInspector.TimelineGrid.Calculator.prototype = { | 286 WebInspector.TimelineGrid.Calculator.prototype = { |
| 310 /** | 287 /** |
| (...skipping 19 matching lines...) Expand all Loading... |
| 330 | 307 |
| 331 /** @return {number} */ | 308 /** @return {number} */ |
| 332 zeroTime: function() { }, | 309 zeroTime: function() { }, |
| 333 | 310 |
| 334 /** @return {number} */ | 311 /** @return {number} */ |
| 335 maximumBoundary: function() { }, | 312 maximumBoundary: function() { }, |
| 336 | 313 |
| 337 /** @return {number} */ | 314 /** @return {number} */ |
| 338 boundarySpan: function() { } | 315 boundarySpan: function() { } |
| 339 } | 316 } |
| OLD | NEW |