Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
E
ecommerce-ui
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
ecommerce-ui
Commits
ff53562f
Commit
ff53562f
authored
Jul 31, 2013
by
Sven Franck
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix/Paginations: set prev/next correctly for last item returned by allDocs
parent
626c6885
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
3 deletions
+2
-3
modules/ui/pagination/pagination.js
modules/ui/pagination/pagination.js
+2
-3
No files found.
modules/ui/pagination/pagination.js
View file @
ff53562f
...
...
@@ -14,9 +14,9 @@ define([
// TODO: this should receive the total number of results of a query/search!
priv
.
getPrevNextItem
=
function
(
arr
,
id
,
next
,
max
)
{
var
step
=
next
?
1
:
-
1
,
position
,
id
;
for
(
position
=
1
;
position
<
max
;
position
+=
1
)
{
if
(
position
===
parseFloat
(
id
))
{
for
(
position
=
1
;
position
<=
max
;
position
+=
1
)
{
if
(
position
===
parseFloat
(
id
))
{
// we have found the position in the array, get prev/next
if
(
next
)
{
if
(
arr
[
position
]
===
undefined
)
{
...
...
@@ -75,7 +75,6 @@ define([
// TODO: this is bad, because we can only point to doc_id, no matter what
// identifier we are setting. item_id itself is... bad... fix!
next
=
priv
.
getPrevNextItem
(
response
.
rows
,
currentId
,
true
,
response
.
total_rows
);
if
(
!
next
)
{
markup
=
params
.
source
.
replace
(
"
translate next
"
,
"
translate next ui-state-disabled
"
);
}
else
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment