Author: lixu
Date: Wed Feb 1 20:11:54 2012
New Revision: 1239299
URL: http://svn.apache.org/viewvc?rev=1239299&view=rev
Log:
SHINDIG-1696 | call gadgets.window.adjustWidth results in infinite loop
Modified:
shindig/trunk/features/src/main/javascript/features/dynamic-width/dynamic-width.js
Modified:
shindig/trunk/features/src/main/javascript/features/dynamic-width/dynamic-width.js
URL:
http://svn.apache.org/viewvc/shindig/trunk/features/src/main/javascript/features/dynamic-width/dynamic-width.js?rev=1239299&r1=1239298&r2=1239299&view=diff
==============================================================================
---
shindig/trunk/features/src/main/javascript/features/dynamic-width/dynamic-width.js
(original)
+++
shindig/trunk/features/src/main/javascript/features/dynamic-width/dynamic-width.js
Wed Feb 1 20:11:54 2012
@@ -50,13 +50,15 @@ gadgets.window = gadgets.window || {};
viewportWidth++; // Adjust for 1px inaccuracy in Webkit browsers
}
var callback = null;
+
if (isNaN(opt_width) && viewportWidth >= newWidth) {
// Due to quirks in the width property, the auto-calculated width will
// never be smaller than the size of the viewport. In order to decrease
// the width to a fit size, we must first make the viewport too small
(1px),
// then callback a function that increases the frame to the right width.
+ var savedWidth = newWidth;
callback = function() {
- gadgets.window.adjustWidth();
+ gadgets.window.adjustWidth(savedWidth);
};
newWidth = 1;
}