I created a modal window (full screen) in Suite 8 and works fine but I was trying to see if it can automatically resize/center itself when a user resizes the browser window… is there a method for this or is it a create your own function to determine the browser x/y coordinates?
Hello, I use the following code to check the resize event and update the dhx window sizes and position
window.addEventListener('resize', function(event) {
dhx.awaitRedraw().then(function() {
if (dhxWindow) {
const {width, height} = getSizesWindow(); // this function get sizes from dhxWindow
// i am using jquery to get window sizes
const left = ($(window).width() - width) / 2;
const top = ($(window).height() - height) / 2;
dhxWindow.setSize(width, height);
dhxWindow.setPosition(left, top); // centralize dhxWindow
}
});
}, true);
I’m trying to incorporate your function w/ sematik’s suggestions and oddly it works if i hardcode it but as variables or directly inserting (position.left for example) it does not recognize these values. Even if i use parseInt. So, I will tinker w/ it but if you guys have an inkling what the issue may be I’m all ears…I’ll be bacj soo with an update - thanks!