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

Table.js: widthClass must be zero padded. #323

Closed
flopp opened this issue Aug 29, 2020 · 0 comments · Fixed by #351
Closed

Table.js: widthClass must be zero padded. #323

flopp opened this issue Aug 29, 2020 · 0 comments · Fixed by #351
Assignees
Labels

Comments

@flopp
Copy link

flopp commented Aug 29, 2020

assets/src/js/components/Table.js creates the widthClassas

widthClass = "w" + Math.min(98, Math.round(p.Pageviews / state.total * 100 * 2.5));

=> so, there's no leading 0 for values < 10, e.g. w7

assets/src/css/styles.css defines the width classes with leading 0, e.g.

.w07:after{width:7%}

=> The light-green count bars inn the "Top Pages" and "Top Referrers" tables are not displayed properly for values < 10.

To fix this, widthClassshould be zero padded, e.g.

widthClass = "w" + ("" + Math.min(98, Math.round(p.Pageviews / state.total * 100 * 2.5))).padStart(2, '0');
@JackEllis JackEllis added the bug label Apr 7, 2022
LKaemmerling added a commit that referenced this issue May 2, 2022
Closes #323
Signed-off-by: Lukas Kämmerling <lukas.kaemmerling@hetzner-cloud.de>
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants