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

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: 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..2ed6715c2fbdefa7f59c98d40a7b2b9e6da70df5 100644
--- a/chrome/browser/resources/extensions/extension_options_overlay.js
+++ b/chrome/browser/resources/extensions/extension_options_overlay.js
@@ -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.
not at google - send to devlin 2015/03/18 15:35:20 And I wonder if this should use the width/height o
paulmeyer 2015/03/18 17:37:48 I think the reason that overlayGuest isn't used he
not at google - send to devlin 2015/03/18 19:52:06 Ah, that could be it. Once again rendering these
paulmeyer 2015/03/18 21:41:46 Yes, 0,0. I agree, those names are more meaningfu
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