-
Notifications
You must be signed in to change notification settings - Fork 6.8k
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
feat(overlay): add fullscreen-enabled overlay class #1949
feat(overlay): add fullscreen-enabled overlay class #1949
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@quanterion can you also add corresponding unit tests?
* It should be provided in the root component to ensure it is properly shared. | ||
*/ | ||
@Injectable() | ||
export class FullscreenFriendlyOverlayContainer extends OverlayContainer { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This class should go in its own file
|
||
/** | ||
* The OverlayContainer is the container in which all overlays will load. | ||
* It should be provided in the root component to ensure it is properly shared. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Needs a class description that explains what this class is for specifically.
} | ||
|
||
private _getFullscreenElement(): Element { | ||
return document.fullscreenElement || |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need a comment here like
// When the page is put into fullscreen mode, a specific element is specified.
// Only that element and its children are visible when in fullscreen mode.
@jelbourn, comments addresed, also renamed container to FullscreenOverlayContainer as it sounds less verbose, can revert back to old name if it is not appropriate. I tried do add unit-tests like this:
But they are failing because Chrome says: Failed to execute 'requestFullScreen' on 'Element': API can only be initiated by a user gesture. |
@quanterion sounds like we'd need to use an e2e test for this behavior, then, since webdriver acts as user interaction. Can you add an e2e test for this? |
3a70cf3
to
9dab05b
Compare
@jelbourn added e2e tests and rebased on top of the master |
9ee0af0
to
c4909bd
Compare
@jelbourn rebased on top of the latest sdk changes and tests starts failing and I can't understand why, the errors seems to be unrelated to my changes |
c4909bd
to
a56e467
Compare
@jelbourn tests successfully passed after latest rebase |
@jelbourn any chance it can be reviewed? |
@quanterion working on getting through the backlog of PRs in the wake of beta and holidays now |
@quanterion mostly looks good, just a few last comments |
|
||
} | ||
|
||
public toggleFullscreen() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We typically omit the public
access modifier since it's the default
* returns true if it has tried to toggle fullscreen mode | ||
* but provides no guarantees whether it really happened | ||
*/ | ||
toggleFullscreen(element: HTMLElement) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd prefer to omit this function from here, since it falls outside of the responsibility of the OverlayContainer
a56e467
to
07e80c3
Compare
@jelbourn comments addressed and rebased |
LGTM, thanks! |
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
New PR implementing fullscreen mode support https://developer.mozilla.org/en-US/docs/Web/API/Element/requestFullScreen
cc: @jelbourn