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

visitor-map.js calculating wrong height #7284

Closed
lucasHSA opened this issue Feb 24, 2015 · 1 comment
Closed

visitor-map.js calculating wrong height #7284

lucasHSA opened this issue Feb 24, 2015 · 1 comment
Assignees
Labels
answered For when a question was asked and we referred to forum or answered it. Task Indicates an issue is neither a feature nor a bug and it's purely a "technical" change.
Milestone

Comments

@lucasHSA
Copy link

Hi,

i'm using the UserCountryMap-Widget as IFrame on our page. But on the bottom of the frame, there are some pixels hidden.

How to reproduce the bug

  1. Open the UserCountryMap on a new window. Like this
  2. Reduce the height of the window, until the map fills the whole window
  3. You will miss some pixels on the bottom of the window and a scrollbar will appear
  4. Now you can change the height and width of the window and the count of the missing pixels will stay the same. If you change the height or width, the map has to fill the whole window.

Scrollbar appears:
map-scrollbar

Changed the width of the window, scrollbar stays:
map-scrollbar-large

Changed the width and the height of the window, scrollbar stays:
map-scrollbar-largest

How to fix

Line 1220 of the visitor-map.js:

maxHeight = $(window).height() - (this.theWidget && this.theWidget.isMaximised ? 150 : 79);

window.height - 79 is not enough. I think the 79px are for the action- and controll-buttons on the bottom of the widget.
But you also need to calculate with the margin of the <div class="widget"> and <div class="UserCountryMap dataTable"...>:

inspektor

The div with the class=widget has margin-top: 10px and margin-bottom: 10px
The div with the class=UserCountryMap dataTable has a margin-bottom: 9px

The border of the div with the class=widget is 1px and already subtracted in Line 1225:

map.container.height(h - 2);

So line 1220 should look like this:

maxHeight = $(window).height() - (this.theWidget && this.theWidget.isMaximised ? 150 : 108);

And the result would be, no scrollbar:
map-fixed

@mattab
Copy link
Member

mattab commented Apr 8, 2015

Hi @lucasHSA

Thanks for the research into this bug! Would you mind creating a pull request with the change? it would help us include it in Piwik faster... cheers

@mattab mattab added the Task Indicates an issue is neither a feature nor a bug and it's purely a "technical" change. label Apr 8, 2015
@mattab mattab added this to the Mid term milestone Apr 8, 2015
@sgiehl sgiehl self-assigned this Dec 20, 2015
@mattab mattab reopened this Dec 20, 2015
@mattab mattab added the answered For when a question was asked and we referred to forum or answered it. label Oct 5, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
answered For when a question was asked and we referred to forum or answered it. Task Indicates an issue is neither a feature nor a bug and it's purely a "technical" change.
Projects
None yet
Development

No branches or pull requests

3 participants