[
https://issues.apache.org/jira/browse/SHINDIG-812?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Adam Winer reopened SHINDIG-812:
--------------------------------
Rolled this back. The patch had 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.
If you could fix these, we can take another look at the patch.
> [PATCH] Attach gadgets.window.adjustHeight to the onresize event
> ----------------------------------------------------------------
>
> Key: SHINDIG-812
> URL: https://issues.apache.org/jira/browse/SHINDIG-812
> Project: Shindig
> Issue Type: Improvement
> Components: Javascript
> Affects Versions: trunk
> Reporter: Audrey Tang
> Assignee: Vincent Siveton
> Priority: Minor
> Fix For: trunk
>
> Attachments: adjustHeight-on-resize-2.diff,
> adjustHeight-on-resize-3.diff, adjustHeight-on-resize.diff
>
>
> The patch below implements the commented TODO functionality of having gadgets
> adjustHeight when the browser window resizes.
> --- trunk/features/dynamic-height/dynamic-height.js
> +++ trunk/features/dynamic-height/dynamic-height.js
> @@ -134,11 +134,19 @@
> oldHeight = newHeight;
> gadgets.rpc.call(null, "resize_iframe", null, newHeight);
> }
> +
> + gadgets.window.resizeAgain = function () {
> + gadgets.window.adjustHeight(opt_height);+ };+
> + if (window.addEventListener) {
> + window.addEventListener("resize", gadgets.window.resizeAgain, false);
> + }
> + else if (window.attachEvent) {
> + window.attachEvent("resize", gadgets.window.resizeAgain);
> + }
> };
> }());
>
> // Alias for legacy code
> var _IG_AdjustIFrameHeight = gadgets.window.adjustHeight;
> -
> -// TODO Attach gadgets.window.adjustHeight to the onresize event
> -
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.