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

Unified Diff: chrome/browser/resources/extensions/extension_options_overlay.js

Issue 1012233002: Fixed resizing animation for extension options. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed comment. Created 5 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/resources/extensions/extension_options_overlay.js
diff --git a/chrome/browser/resources/extensions/extension_options_overlay.js b/chrome/browser/resources/extensions/extension_options_overlay.js
index 593407387c92883cf9af1c2aded9f72705745f02..ea676c705a1137d1cf1f76affe1a41fa3f0c6299 100644
--- a/chrome/browser/resources/extensions/extension_options_overlay.js
+++ b/chrome/browser/resources/extensions/extension_options_overlay.js
@@ -106,7 +106,7 @@ cr.define('extensions', function() {
// maxHeight, but the maxHeight does not include our header height (title
// and close button), so we need to subtract that to get the maxHeight
// for the extension options.
- var maxHeight = parseInt(overlay.style.maxHeight, 10) -
+ var maxHeight = parseInt(overlayStyle.maxHeight, 10) -
overlayHeader.offsetHeight;
var minWidth = parseInt(overlayStyle.minWidth, 10);
@@ -125,8 +125,11 @@ cr.define('extensions', function() {
* @param {{width: number, height: number}} evt
*/
extensionoptions.onpreferredsizechanged = function(evt) {
+ // |overlayStyle.height| includes the header height, so it needs to be
+ // subtracted to get the true old preferred height.
var oldWidth = parseInt(overlayStyle.width, 10);
- var oldHeight = parseInt(overlayStyle.height, 10);
+ var oldHeight =
+ parseInt(overlayStyle.height, 10) - overlayHeader.offsetHeight;
// The overlay must be slightly larger than the extension options to
// avoid creating scrollbars.
// TODO(paulmeyer): This shouldn't be necessary, but the preferred size
@@ -148,9 +151,13 @@ cr.define('extensions', function() {
if (animation)
animation.cancel();
+ // The header height must be added to the (old and new) preferred
+ // heights to get the full overlay heights.
animation = overlay.animate([
- {width: oldWidth + 'px', height: oldHeight + 'px'},
- {width: newWidth + 'px', height: newHeight + 'px'}
+ {width: oldWidth + 'px',
+ height: (oldHeight + overlayHeader.offsetHeight) + 'px'},
+ {width: newWidth + 'px',
+ height: (newHeight + overlayHeader.offsetHeight) + 'px'}
], {
duration: animationTime,
delay: 0
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698