IF YOU WOULD LIKE TO GET AN ACCOUNT, please write an email to s dot adaszewski at gmail dot com. User accounts are meant only to report issues and/or generate pull requests. This is a purpose-specific Git hosting for ADARED projects. Thank you for your understanding!
Просмотр исходного кода

Improved WBPagination, three dots now move to the middle of neighboring pages.

master
Stanislaw Adaszewski 4 лет назад
Родитель
Сommit
438dc4bb18
1 измененных файлов: 4 добавлений и 3 удалений
  1. +4
    -3
      frontend/src/js/widget/wb-pagination.js

+ 4
- 3
frontend/src/js/widget/wb-pagination.js Просмотреть файл

@@ -28,13 +28,14 @@ class WBPagination extends Component {
</li>
));
for (let idx in visible) {
for (let idx = 0; idx < visible.length; idx++) {
let i = visible[idx];
let capturePrev = prev;
if (i > prev + 1)
res.push((
<li class="page-item">
<a class="page-link" href={ getPageUrl(i - 1) }
onclick={ e => this.changePage(e, i - 1) }>...</a>
<a class="page-link" href={ getPageUrl(Math.round((i + capturePrev) / 2)) }
onclick={ e => this.changePage(e, Math.round((i + capturePrev) / 2)) }>...</a>
</li>
));
prev = i;


Загрузка…
Отмена
Сохранить