Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
nexedi
/
renderjs
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Graphs
Merge Requests
1
Network
Create a new issue
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
Commit 83d1db17
authored
2017-09-04 18:00:48 +0200
by
Romain Courteaud
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
onLoop: call the callback function with the gadget as 'this'
1 parent
a5273d87
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
2 deletions
renderjs.js
test/renderjs_test.js
renderjs.js
View file @
83d1db1
...
...
@@ -512,6 +512,7 @@
}
this
.
__service_list
.
push
(
function
()
{
var
queue_loop
=
new
RSVP
.
Queue
(),
context
=
this
,
wait
=
function
()
{
queue_loop
.
push
(
function
()
{
...
...
@@ -522,7 +523,7 @@
return
promiseAnimationFrame
();
})
.
push
(
function
()
{
return
callback
.
apply
(
this
,
[]);
return
callback
.
apply
(
context
,
[]);
})
.
push
(
function
()
{
wait
();
...
...
test/renderjs_test.js
View file @
83d1db1
...
...
@@ -2807,6 +2807,7 @@
klass
.
onLoop
(
function
(
evt
)
{
service_status
.
start_count
+=
1
;
service_status
.
this
=
this
;
return
new
RSVP
.
Queue
()
.
push
(
function
()
{
service_status
.
status
=
"started"
;
...
...
@@ -2823,6 +2824,7 @@
test
(
'callback is triggered on timeout'
,
function
()
{
var
service1
=
{},
gadget
=
new
RenderJSGadget
(),
sub_gadget
,
html_url
=
'https://example.org/files/qunittest/test599.html'
;
gadget
.
__sub_gadget_dict
=
{};
...
...
@@ -2832,7 +2834,7 @@
document
.
getElementById
(
'qunit-fixture'
).
innerHTML
=
"<div></div>"
;
stop
();
expect
(
9
);
expect
(
11
);
renderJS
.
declareGadgetKlass
(
html_url
)
.
then
(
function
(
Klass
)
{
declareTimeoutToCheck
(
Klass
,
service1
);
...
...
@@ -2843,12 +2845,14 @@
);
})
.
then
(
function
(
g
)
{
sub_gadget
=
g
;
return
RSVP
.
delay
(
50
);
})
.
then
(
function
()
{
equal
(
service1
.
start_count
,
1
);
equal
(
service1
.
stop_count
,
0
);
equal
(
service1
.
status
,
"started"
);
equal
(
service1
.
this
,
sub_gadget
);
service1
.
defer
.
resolve
();
return
RSVP
.
delay
(
50
);
})
...
...
@@ -2856,6 +2860,7 @@
equal
(
service1
.
start_count
,
2
);
equal
(
service1
.
stop_count
,
1
);
equal
(
service1
.
status
,
"started"
);
equal
(
service1
.
this
,
sub_gadget
);
return
RSVP
.
delay
(
50
);
})
.
then
(
function
()
{
...
...
Write
Preview
Styling with
Markdown
is supported
Attach a file
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 post a comment