mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-06-28 14:55:48 +00:00
Make pagination numbers locale aware for #1056
This commit is contained in:
@@ -72,14 +72,15 @@ computedPaginatorHelper = (koCurrentPage, koPageCount) => {
|
||||
const currentPage = koCurrentPage(),
|
||||
pageCount = koPageCount(),
|
||||
result = [],
|
||||
lang = doc.documentElement.lang,
|
||||
fAdd = (index, push = true, customName = '') => {
|
||||
const data = {
|
||||
current: index === currentPage,
|
||||
name: customName ? customName.toString() : index.toString(),
|
||||
custom: !!customName,
|
||||
title: customName ? index.toString() : '',
|
||||
value: index.toString()
|
||||
};
|
||||
const name = index.toLocaleString(lang),
|
||||
data = {
|
||||
current: index === currentPage,
|
||||
name: customName || name,
|
||||
title: customName ? name : '',
|
||||
value: index
|
||||
};
|
||||
|
||||
push ? result.push(data) : result.unshift(data);
|
||||
};
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
<nav class="e-paginator g-ui-user-select-none" data-bind="foreach: $data">
|
||||
<a data-bind="css: { 'current': current, 'custom': custom }, title: title, text: name"></a>
|
||||
<a data-bind="css: { 'current': current }, title: title, text: name"></a>
|
||||
</nav>
|
||||
|
||||
Reference in New Issue
Block a user