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

number of paginators error on mobile devices #27

Open
aiden-leong opened this issue May 12, 2017 · 2 comments
Open

number of paginators error on mobile devices #27

aiden-leong opened this issue May 12, 2017 · 2 comments

Comments

@aiden-leong
Copy link

nodeBB version: 1.5.0
recent card version: 0.4.0

@aiden-leong
Copy link
Author

snip20170512_1

@aiden-leong
Copy link
Author

aiden-leong commented May 12, 2017

nodebb.min.js

Line 21519

m = function() {
var e = 1;
if ("horizontal" == o.settings.mode && o.settings.slideWidth > 0)
if (o.viewport.width() < o.minThreshold)
e = o.settings.minSlides;
else if (o.viewport.width() > o.maxThreshold)
e = o.settings.maxSlides;
else {
var t = o.children.first().width();
e = Math.floor(o.viewport.width() / t)
}
else
"vertical" == o.settings.mode && (e = o.settings.minSlides);
return e
}

function m calculates the proper number of cards by o.viewport.width() / t, while t is the width of the card.

Line 21534

v = function() {
var e = 0;
if (o.settings.moveSlides > 0)
if (o.settings.infiniteLoop)
e = o.children.length / y();
else
for (var t = 0, n = 0; t < o.children.length; )
++e,
t = n + m(),
n += o.settings.moveSlides <= m() ? o.settings.moveSlides : m();
else
e = Math.ceil(o.children.length / m());
return e
}

The if statement always falls to e = Math.ceil(o.children.length / m());
o.children.length is 20.
If o.viewport.width is small, m() will be 1.
e will be 20.
This means the smaller your screen.width is, the more cards will be shown on the screen.

Probable solution:
e = Math.ceil(o.children.length / m());
to
e = m();

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

1 participant