New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fitViewport in dialog does consider header/footer height #899
Comments
Ok - I found a work-around: Hook into the postShow function and use css to make the content scrollable: var origPostShow = PrimeFaces.widget.Dialog.prototype.postShow;
PrimeFaces.widget.Dialog.prototype.postShow = function () {
this.initSize();
origPostShow.apply( this );
};
PrimeFaces.widget.Dialog.prototype.fitViewport = function () {
var winHeight = $( window ).height();
var contentPadding = this.content.innerHeight() - this.content.height();
this.content.css("max-height", (winHeight - this.titlebar.outerHeight() - contentPadding - this.footer.outerHeight()) + "px" );
this.content.css("overflow", "auto");
}; |
good @matthiasblaesing , I had seen this problem and solved in a very similar way `//Considers the footer size in the calculation if exists footer //Saves the postShow event in a new event to be used later //Overwrite the event postShow calling fitViewport event |
Same Problem here. Thanks a lot for your work-arounds! An official fix would be nice! |
There is still a Problem when the window is resized (e.g. screen is rotated on mobile). |
In fitViewport function there is a problem with getting right sizes if the dialog has dynamic = "true", because dialog is hidden. my solution was: |
fix #899: enhance dialog fitViewport funcionality
The facelets page below should show a dialog with a content, that is to large to fit on the window. It is expected, that the dialog content is sized, so that header an footer fit the window.
Currently after clicking on "Show Dialog" the dialog is correctly opened, but the footer is invisible (outside the window to the south). When the dialog is resized, the dialog snaps to the right size.
The test was done with:
primefaces 5.3
payara 4.1.153
Client browsers Firefox 42, Chromium 45 and IE 11
The text was updated successfully, but these errors were encountered: