I’ve been trying to get the H5P Framework to work in a Wisej application. Everything seems to be working now except for one thing: The HtmlPanel that “hosts” the H5P content contains a <div> which appears to have a fixed size of 100px * 50px, specified directly in its “style” attribute. If I remove these properties from the style or resize the panel (e.g. by resizing the window) everything seems to work. The div isn’t part of my code, it also has the “qx-widget” class.
After removing the width and height properties it all works:
Is there any way to either remove/disable this div (or its width and height properties), or have its size updated? I guess it might have to do with H5P being loaded after the size of the div is set.
You need to have the instance reference to the wisej.web.ScrollableHtmlPanel widget to invoke a resize. But you have it in “this” you can do:
If you know where it is, lets say it’s a control in the MainPane, you can do this:
Your entire control object model available by name and hierarchy in the browser under App. So if htmlPanel1 is a child of panel1, you have to refer to it as:
You can explore the object model easily with F12 and type App.
Also, the entire source code for all Wisej widgets is available in clear when running in debug mode at http://localhost/resource.wx/wisej.js and http://localhost/resource.wx/qx.js. You can step in, debug it, and even change it.
I’m implementing this inside a Widget, so I have a reference to the Widget in the InitScript. This also allows me to access the HtmlPanel.
Calling __updateHtmlSize() in the wisej.utils.Loader.load callback appears to work. Thanks!
I wanted to come back to this issue: Changing the size of the HtmlPanel does indeed work. But it’s kind of ugly to do it periodically. I’d like to ask if you could give me the JS code that triggers the resize. I have the Wisej JS loader invoke a JS callback when it is done loading the H5P scripts, so I guess this would be a perfect place to trigger a resize.
It’s not hard coded, it’s calculated when the content is displayed, when the size of the HtmlPanel is changed, and when the scrollbars are forces off. It’s necessary to calculate it to manage the container’s scrollbar since we use themed scroll bars.
Try to increase the height of the HtmlPanel by 1 pixel after the H5P content is fully displayed and let me know if the content is resized. In case I can give you a simple javscript that triggers the resize on a timer.
Please login first to submit.