Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(445)

Side by Side Diff: Source/devtools/front_end/InspectorView.js

Issue 214663005: [DevTools] Add preferred size to WebInspector.View. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Two methods Created 6 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « Source/devtools/front_end/DOMExtension.js ('k') | Source/devtools/front_end/SourcesPanel.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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 };
OLDNEW
« no previous file with comments | « Source/devtools/front_end/DOMExtension.js ('k') | Source/devtools/front_end/SourcesPanel.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698