Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
J
jio
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
Xiaowu Zhang
jio
Commits
cefca6fe
Commit
cefca6fe
authored
Apr 02, 2014
by
Tristan Cavelier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add limit option management
parent
e6a50e62
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
2 deletions
+25
-2
src/jio.storage/indexeddbstorage.js
src/jio.storage/indexeddbstorage.js
+25
-2
No files found.
src/jio.storage/indexeddbstorage.js
View file @
cefca6fe
...
...
@@ -384,10 +384,33 @@
index_req
=
index
.
openCursor
();
date
=
Date
.
now
();
index_req
.
onsuccess
=
function
()
{
var
cursor
=
index_req
.
result
,
now
;
index_req
.
onsuccess
=
function
(
event
)
{
var
cursor
=
event
.
target
.
result
,
now
;
if
(
cursor
)
{
// Called for each matching record.
if
(
Array
.
isArray
(
option
.
limit
))
{
if
(
option
.
limit
.
length
>
1
)
{
if
(
option
.
limit
[
0
]
>
0
)
{
option
.
limit
[
0
]
-=
1
;
cursor
.
continue
();
return
;
}
if
(
option
.
limit
[
1
]
<=
0
)
{
// end
index_req
.
onsuccess
({
"
target
"
:
{}});
return
;
}
option
.
limit
[
1
]
-=
1
;
}
else
{
if
(
option
.
limit
[
0
]
<=
0
)
{
// end
index_req
.
onsuccess
({
"
target
"
:
{}});
return
;
}
option
.
limit
[
0
]
-=
1
;
}
}
if
(
option
.
include_docs
)
{
rows
.
push
({
"
id
"
:
cursor
.
value
.
_id
,
...
...
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