How to resize panel-extension, CSInterface.js function "resizeContent" not working.
Hi all,
the problem seems to be very simple, but I cant find a solution, so far.
I want to resize the window of my extension during runtime.
I am using CSInterface v7.0.0.
In the file "manifest.xml" the following code defines the size of the panel-extension-window:
<Extension Id="EasySelectionOptions">
<DispatchInfo>
<Resources>
<MainPath>./html/EasySelectionSettings.html</MainPath>
<CEFCommandLine/>
</Resources>
<Lifecycle>
<AutoVisible>true</AutoVisible>
</Lifecycle>
<UI>
<Type>Panel</Type>
<Menu>Easy Selection</Menu>
<Geometry>
<Size>
<minHeight>240</minHeight>
<minWidth>405</minWidth>
<maxHeight>330</maxHeight>
<maxWidth>415</maxWidth>
<Height>320</Height>
<Width>410</Width>
</Size>
</Geometry>
<Icons/>
</UI>
</DispatchInfo>
</Extension>
In the correspoding ".js" file, I have added the call to the function resizeContent:
function onload()
{
var csInterface = new CSInterface();
// Resize GUI-window
csInterface.resizeContent(410, 250);
updateThemeWithAppSkinInfo(csInterface.hostEnvironment.appSkinInfo);
// Update the color of the panel when the theme color of the product changed.
csInterface.addEventListener(CSInterface.THEME_COLOR_CHANGED_EVENT, onAppThemeColorChanged);
...
...
}
The call of the function addEventListener works fine, but the call of resizeContent has no effect at all.
In the file "CSInterface.js", the description of the function resizeContent mentions that "Extension's manifest min/max size constraints apply and take precedence". But the values I used for resizing meet the constraints and should not be the problem.
So, the next thing I tried was to remove the tags "<Height>" and "<Width>" from the manifest.xml file and only keep the tags "<min/maxHeight>" and "<min/maxWidth>".
After that, the panel-extension window did not even appear anymore!
I even tried to change the value of the tag "<Type>" to Modeless instead of Panel, but this did not work as well.
It seems as if the function resizeContent has no effect at all.
Update:
I just found out, that instead of the tags "<min/maxWidth>" and "<min/maxHeight>", the tags "<MinSize>" and "<MaxSize>" should be used in the "manifest.xml" file:
<UI>
<Type>Panel</Type>
<Menu>Easy Selection</Menu>
<Geometry>
<Size>
<Height>240</Height>
<Width>410</Width>
</Size>
<MinSize>
<Height>240</Height>
<Width>410</Width>
</MinSize>
<MaxSize>
<Height>320</Height>
<Width>410</Width>
</MaxSize>
</Geometry>
<Icons/>
</UI>Afterwards, the panel-extension window was manually resizable using the mouse-cursor.
But unfortunately, the function resizeContent is still not working.
What am I missing?
How can I resize the extension window during runtime, using JavaScript and/or the CSInterface?
Thank you very much in advance.
Best Regards,
Fabian Taubitz
