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
lucas.parsy
jio
Commits
b3a6839e
Commit
b3a6839e
authored
Apr 02, 2014
by
Tristan Cavelier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
notification management part moved
Indeed, it avoid jIO to trigger timeout event if no documents are found.
parent
cefca6fe
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
5 deletions
+12
-5
src/jio.storage/indexeddbstorage.js
src/jio.storage/indexeddbstorage.js
+12
-5
No files found.
src/jio.storage/indexeddbstorage.js
View file @
b3a6839e
...
...
@@ -388,6 +388,15 @@
var
cursor
=
event
.
target
.
result
,
now
;
if
(
cursor
)
{
// Called for each matching record.
// notification management
now
=
Date
.
now
();
if
(
date
<=
now
-
1000
)
{
notify
({
"
loaded
"
:
rows
.
length
});
date
=
now
;
}
// option.limit management
if
(
Array
.
isArray
(
option
.
limit
))
{
if
(
option
.
limit
.
length
>
1
)
{
if
(
option
.
limit
[
0
]
>
0
)
{
...
...
@@ -411,6 +420,7 @@
}
}
// option.include_docs management
if
(
option
.
include_docs
)
{
rows
.
push
({
"
id
"
:
cursor
.
value
.
_id
,
...
...
@@ -423,11 +433,8 @@
"
value
"
:
{}
});
}
now
=
Date
.
now
();
if
(
date
<=
now
-
1000
)
{
notify
({
"
loaded
"
:
rows
.
length
});
date
=
now
;
}
// continue to next iteration
cursor
.
continue
();
}
else
{
notify
({
"
loaded
"
:
rows
.
length
});
...
...
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