Author: awiner
Date: Mon Apr 13 17:07:01 2009
New Revision: 764533
URL: http://svn.apache.org/viewvc?rev=764533&view=rev
Log:
Rolling back SHINDIG-812, as it has introduced multiple problems:
- In Safari and Chrome, gadgets using auto-resizing are now in an infinite loop
of expanding by 1. (Likely applies to all WebKit-based browsers)
- A sequence of calls like:
adjustHeight(10)
adjustHeight(100)
adjustHeight(10)
... fails, as the third height is the same as the height 2 updates ago, so the
third update call is ignored.
Also, there's improper whitespace problems, an === was changed to ==,
"oldHeight2" is an insufficiently descriptive variable name, etc.
Modified:
incubator/shindig/trunk/features/src/main/javascript/features/dynamic-height/dynamic-height.js
Modified:
incubator/shindig/trunk/features/src/main/javascript/features/dynamic-height/dynamic-height.js
URL:
http://svn.apache.org/viewvc/incubator/shindig/trunk/features/src/main/javascript/features/dynamic-height/dynamic-height.js?rev=764533&r1=764532&r2=764533&view=diff
==============================================================================
---
incubator/shindig/trunk/features/src/main/javascript/features/dynamic-height/dynamic-height.js
(original)
+++
incubator/shindig/trunk/features/src/main/javascript/features/dynamic-height/dynamic-height.js
Mon Apr 13 17:07:01 2009
@@ -36,7 +36,6 @@
(function() {
var oldHeight;
- var oldHeight2;
/**
* Detects the inner dimensions of a frame.
@@ -131,31 +130,15 @@
}
// Only make the IFPC call if height has changed
- if (newHeight != oldHeight && (newHeight != oldHeight2 || newHeight >
oldHeight)) {
- oldHeight2 = oldHeight;
+ if (newHeight !== oldHeight) {
oldHeight = newHeight;
gadgets.rpc.call(null, "resize_iframe", null, newHeight);
}
-
- gadgets.window.opt_height = opt_height;
-
- if (gadgets.window.resizeListenerIsAttached) {
- return;
- }
- gadgets.window.resizeListenerIsAttached = true;
-
- var resizeAgain = function () {
- gadgets.window.adjustHeight(gadgets.window.opt_height);
- };
-
- if (window.addEventListener) {
- window.addEventListener("resize", resizeAgain, false);
- }
- else if (window.attachEvent) {
- window.attachEvent("resize", resizeAgain);
- }
};
}());
// Alias for legacy code
-var _IG_AdjustIFrameHeight = gadgets.window.adjustHeight;
\ No newline at end of file
+var _IG_AdjustIFrameHeight = gadgets.window.adjustHeight;
+
+// TODO Attach gadgets.window.adjustHeight to the onresize event
+