[ 
https://issues.apache.org/jira/browse/SHINDIG-812?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Audrey Tang updated SHINDIG-812:
--------------------------------

    Attachment: adjustHeight-on-resize-3.diff

This is the version as currently used in Socialtext Dashboard; it prevents 
repeated toggling of inner iframe height.

> [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: Features (Javascript)
>    Affects Versions: trunk
>            Reporter: Audrey Tang
>            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.

Reply via email to