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

Fix: Sidebar height calculation #1158

Open
wants to merge 1 commit into
base: skosmos-2
Choose a base branch
from

Conversation

danmichaelo
Copy link
Contributor

The sidebar is a few pixels too high when the alphabetical list is active, due to the padding of the div containing the letters. This should fix it.

@sonarcloud
Copy link

sonarcloud bot commented Apr 12, 2021

Kudos, SonarCloud Quality Gate passed!

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@codecov
Copy link

codecov bot commented Apr 12, 2021

Codecov Report

Merging #1158 (826e069) into master (4a050f4) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff            @@
##             master    #1158   +/-   ##
=========================================
  Coverage     67.97%   67.97%           
  Complexity     1584     1584           
=========================================
  Files            32       32           
  Lines          3888     3888           
=========================================
  Hits           2643     2643           
  Misses         1245     1245           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 4a050f4...826e069. Read the comment docs.

Copy link
Collaborator

@kinow kinow left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's some sharp eye @danmichaelo 👏

Here's a zoomed-in view of https://dev.finto.fi/ysapaikat/en/page/Y169060?clang=fi (in XFCE/Ubuntu, ALT + Mouse scroll gives you control over monitor zoom).

image

Then applying your JavaScript changes locally with the following script in the browser console:

var pixels = $('.nav-tabs').outerHeight();
if ($('#sidebar > .pagination').is(':visible')) { pixels += $('.pagination').outerHeight(); }
$('.sidebar-grey').attr('style', pixels)

image

Worked for me on Firefox + Ubuntu. Might be good to check the other browsers perhaps, but using outerHeight sounds like the right approach, instead of using a 2px buffer 👍 (probably could use 100vh - $var too)

Bruno

@danmichaelo
Copy link
Contributor Author

danmichaelo commented Apr 14, 2021

Actually I don't have that good eyes 😆 I realize that my description above was a bit brief – I forgot to mention that the problem was that the extra height causes a scrollbar on pages that should not have a scrollbar (only when using the alphabetical tab):

Screenshot 2021-04-14 at 19 53 44

That the patch also removes the extra padding on the hierarchical tab was just a lucky side effect 😄

I tested the following snippet in the browser console in Firefox, Chrome and Safari on Mac now:

$('.sidebar-grey').attr('style', function() {
    var pixels = $('.nav-tabs').outerHeight() ;
    if ($('#sidebar > .pagination').is(':visible')) { pixels += $('.pagination').outerHeight(); } 
    return 'height: calc(100% - ' + pixels + 'px) !important';
});

Seems to give a tight fit on both the alphabetical and hierarchical tab 👍

@kinow
Copy link
Collaborator

kinow commented Apr 14, 2021

I cannot reproduce that on Firefox or Chromium on Ubuntu, but could be happening on other platforms/browsers. (screenshot without any changes to Skosmos).

image

@kouralex kouralex added this to Proposed product backlog items in Sprint Backlog II/2021 May 12, 2021
@danmichaelo
Copy link
Contributor Author

I cannot reproduce that on Firefox or Chromium on Ubuntu, but could be happening on other platforms/browsers. (screenshot without any changes to Skosmos).

image

You are on the hierarchy tab, could you check if you can reproduce in on the A-Z tab? For me, it's also not a problem on the hierarchy tab.

@osma osma added this to Proposed product backlog items in Sprint Backlog IV/2021 Sep 2, 2021
@osma osma added this to Proposed product backlog items in Sprint Backlog III/2021 Sep 2, 2021
@osma osma removed this from Proposed product backlog items in Sprint Backlog IV/2021 Sep 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Sprint Backlog II/2021
  
Proposed product backlog items
Sprint Backlog III/2021
  
Proposed product backlog items
Development

Successfully merging this pull request may close these issues.

None yet

3 participants