Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
jio
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
18
Merge Requests
18
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
nexedi
jio
Commits
6a331465
Commit
6a331465
authored
Sep 05, 2013
by
Tristan Cavelier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Promise notify propagates to all then progress
parent
db7c70a2
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
1 deletion
+17
-1
src/jio/core/Promise.js
src/jio/core/Promise.js
+17
-1
No files found.
src/jio/core/Promise.js
View file @
6a331465
...
...
@@ -519,7 +519,23 @@ Promise.prototype.then = function (onSuccess, onError, onProgress) {
});
}
if
(
typeof
onProgress
===
'
function
'
)
{
this
.
_onProgress
.
push
(
onProgress
);
this
.
_onProgress
.
push
(
function
()
{
var
result
;
try
{
result
=
onProgress
.
apply
(
that
,
arguments
);
if
(
result
===
undefined
)
{
resolver
.
notify
.
apply
(
that
,
arguments
);
}
else
{
resolver
.
notify
(
result
);
}
}
catch
(
e
)
{
resolver
.
notify
.
apply
(
that
,
arguments
);
}
});
}
else
{
this
.
_onProgress
.
push
(
function
()
{
resolver
.
notify
.
apply
(
resolver
,
arguments
);
});
}
break
;
}
...
...
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