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
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Tristan Cavelier
jio
Commits
337621d9
Commit
337621d9
authored
Apr 02, 2014
by
Tristan Cavelier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add notifications for indexeddb allDocs
parent
56f442e1
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
3 deletions
+10
-3
src/jio.storage/indexeddbstorage.js
src/jio.storage/indexeddbstorage.js
+10
-3
No files found.
src/jio.storage/indexeddbstorage.js
View file @
337621d9
...
...
@@ -366,13 +366,13 @@
// XXX doc string
IndexedDBStorage
.
prototype
.
getList
=
function
()
{
var
rows
=
[],
onCancel
,
open_req
=
indexedDB
.
open
(
this
.
_database_name
);
return
new
Promise
(
function
(
resolve
,
reject
)
{
return
new
Promise
(
function
(
resolve
,
reject
,
notify
)
{
open_req
.
onerror
=
function
()
{
if
(
open_req
.
result
)
{
open_req
.
result
.
close
();
}
reject
(
open_req
.
error
);
};
open_req
.
onsuccess
=
function
()
{
var
tx
,
store
,
index
,
index_req
,
db
=
open_req
.
result
;
var
tx
,
store
,
index
,
date
,
index_req
,
db
=
open_req
.
result
;
try
{
tx
=
db
.
transaction
(
"
metadata
"
,
"
readonly
"
);
onCancel
=
function
()
{
...
...
@@ -383,8 +383,9 @@
index
=
store
.
index
(
"
_id
"
);
index_req
=
index
.
openCursor
();
date
=
Date
.
now
();
index_req
.
onsuccess
=
function
()
{
var
cursor
=
index_req
.
result
;
var
cursor
=
index_req
.
result
,
now
;
if
(
cursor
)
{
// Called for each matching record.
rows
.
push
({
...
...
@@ -392,8 +393,14 @@
"
doc
"
:
cursor
.
value
,
"
value
"
:
{}
});
now
=
Date
.
now
();
if
(
date
<=
now
-
1000
)
{
notify
({
"
loaded
"
:
rows
.
length
});
date
=
now
;
}
cursor
.
continue
();
}
else
{
notify
({
"
loaded
"
:
rows
.
length
});
// No more matching records.
resolve
({
"
data
"
:
{
"
rows
"
:
rows
,
"
total_rows
"
:
rows
.
length
}});
db
.
close
();
...
...
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