OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2011 Google Inc. All rights reserved. | 2 * Copyright (C) 2011 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 475 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
486 { | 486 { |
487 // If we didn't have enough space at the start, we may have wrong scroll
offsets. | 487 // If we didn't have enough space at the start, we may have wrong scroll
offsets. |
488 if (document.body.scrollTop !== 0) | 488 if (document.body.scrollTop !== 0) |
489 document.body.scrollTop = 0; | 489 document.body.scrollTop = 0; |
490 if (document.body.scrollLeft !== 0) | 490 if (document.body.scrollLeft !== 0) |
491 document.body.scrollLeft = 0; | 491 document.body.scrollLeft = 0; |
492 }, | 492 }, |
493 | 493 |
494 doResize: function() | 494 doResize: function() |
495 { | 495 { |
496 var size = this.minimumSize(); | 496 var size = this.constraints().minimum; |
497 var right = Math.min(0, window.innerWidth - size.width); | 497 var right = Math.min(0, window.innerWidth - size.width); |
498 this.element.style.right = right + "px"; | 498 this.element.style.right = right + "px"; |
499 var bottom = Math.min(0, window.innerHeight - size.height); | 499 var bottom = Math.min(0, window.innerHeight - size.height); |
500 this.element.style.bottom = bottom + "px"; | 500 this.element.style.bottom = bottom + "px"; |
501 | 501 |
502 if (window.innerWidth < size.width || window.innerHeight < size.height) | 502 if (window.innerWidth < size.width || window.innerHeight < size.height) |
503 window.addEventListener("scroll", this._onScrollBound, false); | 503 window.addEventListener("scroll", this._onScrollBound, false); |
504 else | 504 else |
505 window.removeEventListener("scroll", this._onScrollBound, false); | 505 window.removeEventListener("scroll", this._onScrollBound, false); |
506 | 506 |
507 WebInspector.VBox.prototype.doResize.call(this); | 507 WebInspector.VBox.prototype.doResize.call(this); |
508 this._onScroll(); | 508 this._onScroll(); |
509 }, | 509 }, |
510 | 510 |
511 __proto__: WebInspector.VBox.prototype | 511 __proto__: WebInspector.VBox.prototype |
512 }; | 512 }; |
OLD | NEW |