Skip to content
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

Bug? When enter browser fullscreen in the beforeMaximize event, height of dialog is not adjusted to full height within the maximize action #36

Open
JohnRanger opened this issue Mar 30, 2020 · 1 comment

Comments

@JohnRanger
Copy link

Hi all,

I am trying to automatically enter the browser's fullscreen mode when maximizing a jquery dialog which is extended with dialogExtend.

I do this by having the following code within the "beforeMaximize" callback:

"beforeMaximize": function () {
	//alert("before");
	this.openFullScreen();
}.bind(this)

where openFullscreen is like this:

private openFullScreen() {
	this.isInFullScreen = true;
	var elem = document.body;
	if (elem.requestFullscreen) {
		elem.requestFullscreen();
	} else if (elem.mozRequestFullScreen) { /* Firefox */
		elem.mozRequestFullScreen();
	} else if (elem.webkitRequestFullscreen) { /* Chrome, Safari and Opera */
		elem.webkitRequestFullscreen();
	} else if (elem.msRequestFullscreen) { /* IE/Edge */
		elem.msRequestFullscreen();
	}
}

Entering the browser's fullscreen mode works fine - but the resulting jquery dialog does not extend to the full available height.

Why is the dialogExtend maximize function not recognizing the correct height?

How to set jQuery Dialog to full available height in maximize event?

With kind regards,

John

@JohnRanger JohnRanger changed the title Bug? When enter browser fullscreen in the beforeMaximize event, height of dialog is not adjusted to full height Bug? When enter browser fullscreen in the beforeMaximize event, height of dialog is not adjusted to full height within the maximize action Mar 30, 2020
@JohnRanger
Copy link
Author

JohnRanger commented Mar 31, 2020

Hi all,

I have at least found a workaround. For reference it goes like this:

"maximize": function () {

	this.element.css({
		height: window.outerHeight
	});

	this.arrange();

}.bind(this)

where this.arrange is a function which redraws the content of the dialog.

I have also seen that when I use window.innerheight (which most probably is also used by the maximize action of dialogExtend) the value there is too small. Must be a timing problem.

So a possible fix would be to provide a switch which could be set within the beforeMaximize method to tell the dialogExtend engine to use window.outerheight instead of window.innerheight when calculating the maximized height of the dialog.

With kind regards,

John

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant