diff options
author | eroman@chromium.org <eroman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-04-20 05:24:31 +0000 |
---|---|---|
committer | eroman@chromium.org <eroman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-04-20 05:24:31 +0000 |
commit | b2d346da57198822ddf59563a7c100eb6f6bc5a2 (patch) | |
tree | 360f76acada9a351d65b366f076dd18ef57dd68b /chrome/browser/resources | |
parent | db6535facc40cf2ca1aa7eb9119a818a91de375f (diff) | |
download | chromium_src-b2d346da57198822ddf59563a7c100eb6f6bc5a2.zip chromium_src-b2d346da57198822ddf59563a7c100eb6f6bc5a2.tar.gz chromium_src-b2d346da57198822ddf59563a7c100eb6f6bc5a2.tar.bz2 |
Minor aesthetic change on new net internals page: when you resize the window and it is in the requests view, grow the right box (details view) to fit the new space, rather than growing the left box.
BUG=37421
Review URL: http://codereview.chromium.org/1627026
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@45013 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/resources')
-rw-r--r-- | chrome/browser/resources/net_internals/resizableverticalsplitview.js | 28 |
1 files changed, 16 insertions, 12 deletions
diff --git a/chrome/browser/resources/net_internals/resizableverticalsplitview.js b/chrome/browser/resources/net_internals/resizableverticalsplitview.js index 78b62a0..289e20d 100644 --- a/chrome/browser/resources/net_internals/resizableverticalsplitview.js +++ b/chrome/browser/resources/net_internals/resizableverticalsplitview.js @@ -52,18 +52,18 @@ ResizableVerticalSplitView.prototype.setGeometry = function( this, left, top, width, height); // If this is the first setGeometry(), initialize the split point at 50%. - if (!this.rightSplit_) - this.rightSplit_ = parseInt((width / 2).toFixed(0)); + if (!this.leftSplit_) + this.leftSplit_ = parseInt((width / 2).toFixed(0)); // Calculate the horizontal split points. - var rightboxWidth = this.rightSplit_; + var leftboxWidth = this.leftSplit_; var sizerWidth = this.sizerView_.getWidth(); - var leftboxWidth = width - (rightboxWidth + sizerWidth); + var rightboxWidth = width - (leftboxWidth + sizerWidth); - // Don't let the left pane get too small. - if (leftboxWidth < ResizableVerticalSplitView.MIN_PANEL_WIDTH) { - leftboxWidth = ResizableVerticalSplitView.MIN_PANEL_WIDTH; - rightboxWidth = width - (sizerWidth + leftboxWidth); + // Don't let the right pane get too small. + if (rightboxWidth < ResizableVerticalSplitView.MIN_PANEL_WIDTH) { + rightboxWidth = ResizableVerticalSplitView.MIN_PANEL_WIDTH; + leftboxWidth = width - (sizerWidth + rightboxWidth); } // Position the boxes using calculated split points. @@ -100,13 +100,17 @@ ResizableVerticalSplitView.prototype.onDragSizerStart_ = function(event) { */ ResizableVerticalSplitView.prototype.onDragSizer = function(event) { // Convert from page coordinates, to view coordinates. - this.rightSplit_ = this.getWidth() - (event.pageX - this.getLeft()); + this.leftSplit_ = (event.pageX - this.getLeft()); + // Avoid shrinking the left box too much. + this.leftSplit_ = Math.max( + this.leftSplit_, ResizableVerticalSplitView.MIN_PANEL_WIDTH); // Avoid shrinking the right box too much. - this.rightSplit_ = Math.max( - this.rightSplit_, ResizableVerticalSplitView.MIN_PANEL_WIDTH); + this.leftSplit_ = Math.min( + this.leftSplit_, + this.getWidth() - ResizableVerticalSplitView.MIN_PANEL_WIDTH); - // Force a layout with the new |rightSplit_|. + // Force a layout with the new |leftSplit_|. this.setGeometry( this.getLeft(), this.getTop(), this.getWidth(), this.getHeight()); }; |