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

Fullscreen of the container. #74

Closed
AlexandreDelan opened this issue Sep 28, 2016 · 4 comments
Closed

Fullscreen of the container. #74

AlexandreDelan opened this issue Sep 28, 2016 · 4 comments
Milestone

Comments

@AlexandreDelan
Copy link

AlexandreDelan commented Sep 28, 2016

In my project, I've added a top bar.
In the html code, this new div has been added in the container div (the one given in the container option).

This issue is the fullscreen is not done another "container". The name of the variable is confusing as
"option.container != this.container".

see bellow.

this.parent = (typeof options.container == 'string') ? document.getElementById(options.container) : options.container;
// create actual container
this.container = document.createElement('div');
this.container.classList.add('psv-container');
this.parent.appendChild(this.container);

Anyway I suggest the following update to toggle fullscreen on option.container and not this.container.

Before:

PhotoSphereViewer.prototype.isFullscreenEnabled = function() {
  return PSVUtils.isFullscreenEnabled(this.container);
};
PhotoSphereViewer.prototype.toggleFullscreen = function() {
  if (!this.isFullscreenEnabled()) {
    PSVUtils.requestFullscreen(this.container);
  }
  else {
    PSVUtils.exitFullscreen();
  }
};

After - replacing this.container by this.parent:

PhotoSphereViewer.prototype.isFullscreenEnabled = function() {
  return PSVUtils.isFullscreenEnabled(this.parent);
};
PhotoSphereViewer.prototype.toggleFullscreen = function() {
  if (!this.isFullscreenEnabled()) {
    PSVUtils.requestFullscreen(this.parent);
  }
  else {
    PSVUtils.exitFullscreen();
  }
};
@mistic100
Copy link
Owner

When posting a block of code use triple back-quote with language code (see your message I edited)


I'll see why it's not done like this and if it has impacts.

@mistic100 mistic100 added this to the 3.2.2 milestone Sep 28, 2016
@mistic100
Copy link
Owner

The confusion between parent and container exists because I had to include another layer of DOM to simplify relative positioning, and in the process I forgot to migrate this particular lines of code.

@mistic100
Copy link
Owner

mistic100 commented Nov 4, 2016

Now I remember why the fullscreen was not on the parent : #83 @icexuick

@mistic100
Copy link
Owner

@AlexandreDelan for the sake of simplicity I had to revert back to the old version.
If you want to add a custom toolbar, move it to the container after the viewer has been built (use the "ready" event).

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

2 participants