[
https://issues.apache.org/jira/browse/SHINDIG-812?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12697198#action_12697198
]
Alison Cichowlas commented on SHINDIG-812:
------------------------------------------
Hey,
This patch prevents gadgets from doing, for example,
gadgets.window.adjustHeight(10px);
gadgets.window.adjustHeight(100px);
gadgets.window.adjustHeight(10px);
since the check for newHeight != oldHeight2 || newHeight > oldHeight will cause
the 3rd line to be ineffective. (newheight==oldheight2, newheight < oldheight,
so no height adjust.)
This is a particular problem for gadgets that start off in a minimized state
and can expand and contract from there.
Any chance of a rollback, or should I file a separate bug on this issue?
Thanks,
Alison
> [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.