Hi Jasha, On 23-3-2012 11:16, Jasha Joachimsthal wrote: > On 22 March 2012 22:28, Dennis van der Laan <[email protected]> wrote: > >> My first question is that I noticed gadgets which have a 'height' >> argument in the gadget moduleprefs, are not resized to that height. The >> iframe created for those gadgets have a 'default' height of 250px. I >> tried to search for the code where the iframe is created or the height >> is set, but I was unable to find it. Can anybody confirm that the height >> of the gadget iframe is not resized, based on the 'height' argument in >> the ModulePrefs, or is the gadget module incorrect? >> >> > The dynamic-height cannot detect how much height the iframe needs. You > should be able to let the iframe content notify the container to resize the > iframe with rpc relay calls. As an example the gadget definition in [1] > registers the rpc and calls the adjustHeight. The content of the iframe is > rendered with [2]. The iframe content does an rpc call to the adjustHeight. > As you may see, we've injected the Shindig host there, but at least in the > gadget it can be replaced with gadgets.rpc.getOrigin(window.location.href) > (haven't checked for the iframe content). > > [1] > https://github.com/OpenConext/OpenConext-teams/blob/master/coin-teams-war/src/main/webapp/WEB-INF/jsp/teams.jsp > [2] > https://github.com/OpenConext/OpenConext-teams/blob/master/coin-teams-war/src/main/webapp/WEB-INF/tags/genericpage.tag > > For most of our gadgets, we indeed use dynamic height, by letting the gadget call gadgets.window.adjustHeight(). The rpc-call by which an iframe can control the gadgets height is new to me, so thanks for this example! Unfortunately, we also want to use off-the-shelf gadgets from third parties and they do not use these constructs. I guess providing a 'height' attribute in the ModulePrefs element is optional for a platform to support, but because google at least supports it, most iframe-based gadgets just provide a static height in their gadget definition. As I mentioned, Rave (or Shindig?) currently generates iframes with a default height of 250px, which is hardcoded in the html (not by using CSS). Can you point me to the code where this iframe is generated? Maybe I can provide a patch for supporting the 'height' attribute.
-- Dennis van der Laan, MSc Centre for Information Technology University of Groningen
