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

[Front]搜索页一开始显示6个 #56

Closed
supplient opened this issue Apr 22, 2019 · 1 comment
Closed

[Front]搜索页一开始显示6个 #56

supplient opened this issue Apr 22, 2019 · 1 comment
Assignees
Labels
invalid This doesn't seem right

Comments

@supplient
Copy link
Collaborator

https://github.com/supplient/rateMyCourse/blob/666cc6afa8556d0618d630e9118f1df88518e994/front_end/js/searchResult.js#L196-L198

https://github.com/supplient/rateMyCourse/blob/666cc6afa8556d0618d630e9118f1df88518e994/front_end/js/searchResult.js#L100-L102

上面的>5会导致页面一开始加载的话会加载6个。建议把上面那个,在加载完所有div后直接toPage(1)。当然,要是这是个feature的话当我没说x

附带一提,冗余代码太多了,这里就是个例子,两边逻辑是一样的,而且可以简单调用就能解决问题,但却写了两遍。这样要是某次我们决定要一页显示10个课程的话,会很麻烦,毕竟5是个太常见的数字了,直接全局替换没法解决问题。

@supplient supplient added the invalid This doesn't seem right label Apr 22, 2019
@AyaIsLearning
Copy link
Collaborator

AyaIsLearning commented Apr 23, 2019

添加了toPage(1)
发现应该是大于等于5......

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
invalid This doesn't seem right
Projects
None yet
Development

No branches or pull requests

3 participants