DEV Community πŸ‘©β€πŸ’»πŸ‘¨β€πŸ’»

DEV Community πŸ‘©β€πŸ’»πŸ‘¨β€πŸ’» is a community of 963,274 amazing developers

We're a place where coders share, stay up-to-date and grow their careers.

Create account Log in

Discussion on: Introduction of Floating Window Library β€œJSFrame.js”

Collapse
 
riversun profile image
riversun Author

Hi,

Is this what you want to do?

riversun.github.io/JSFrame.js/publ...

Specify the parent element in JSFrame's initialization parameter.
The next step is to specify the parent element's style as "overflow:hidden" to prevent the window from overflowing from that elements.

Then you might be able to do what you want to do.

Collapse
 
glaucoproj profile image
glauco-proj

Hi,

Great! I was already going through a parentElement but not the style overflow: hidden.

My parent element does not use the entire window area, there is a sidebar menu with 225px. When maximizing, the window gains all the available width (window.innerWidth), exceeding 225px of the screen (horizontal scroll), so i made a change to the function renderMaximizedMode in WindowEventHelper.js:

if (me.hideFrameBorder) {
    var parentElement = frame.jsFrame.windowManager.parentElement; //Not the best way!!
    if (parentElement ) {
        _toWidth = parentElement.offsetWidth;
        _toHeight = parentElement.offsetHeight + (me.hideTitleBar? from.titleBarHeight: 0);
    }
    else {
        _toWidth = window.innerWidth;
        _toHeight = window.innerHeight + (me.hideTitleBar? from.titleBarHeight: 0);
    }
} else {
    ...
}