Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
R
renderjs
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
Romain Courteaud
renderjs
Commits
4499150f
Commit
4499150f
authored
May 15, 2018
by
Romain Courteaud
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
No need to wait for ready if there is no one to execute.
parent
d37a613b
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
16 deletions
+21
-16
renderjs.js
renderjs.js
+21
-16
No files found.
renderjs.js
View file @
4499150f
...
@@ -1073,21 +1073,8 @@
...
@@ -1073,21 +1073,8 @@
.
push
(
function
setGadgetInstanceHTMLContext
(
gadget_instance
)
{
.
push
(
function
setGadgetInstanceHTMLContext
(
gadget_instance
)
{
var
i
,
var
i
,
scope
,
scope
,
queue
=
new
RSVP
.
Queue
()
;
queue
;
clearGadgetInternalParameters
(
gadget_instance
);
clearGadgetInternalParameters
(
gadget_instance
);
// Trigger calling of all ready callback
function
ready_executable_wrapper
(
fct
)
{
return
function
executeReadyWrapper
()
{
return
fct
.
call
(
gadget_instance
,
gadget_instance
);
};
}
for
(
i
=
0
;
i
<
gadget_instance
.
constructor
.
__ready_list
.
length
;
i
+=
1
)
{
// Put a timeout?
queue
.
push
(
ready_executable_wrapper
(
gadget_instance
.
constructor
.
__ready_list
[
i
]
));
}
// Store local reference to the gadget instance
// Store local reference to the gadget instance
scope
=
options
.
scope
;
scope
=
options
.
scope
;
...
@@ -1109,6 +1096,12 @@
...
@@ -1109,6 +1096,12 @@
options
.
sandbox
);
options
.
sandbox
);
gadget_instance
.
element
.
_gadget
=
gadget_instance
;
gadget_instance
.
element
.
_gadget
=
gadget_instance
;
function
ready_executable_wrapper
(
fct
)
{
return
function
executeReadyWrapper
()
{
return
fct
.
call
(
gadget_instance
,
gadget_instance
);
};
}
function
ready_wrapper
()
{
function
ready_wrapper
()
{
if
(
document
.
contains
(
gadget_instance
.
element
))
{
if
(
document
.
contains
(
gadget_instance
.
element
))
{
startService
(
gadget_instance
);
startService
(
gadget_instance
);
...
@@ -1116,9 +1109,21 @@
...
@@ -1116,9 +1109,21 @@
// Always return the gadget instance after ready function
// Always return the gadget instance after ready function
return
gadget_instance
;
return
gadget_instance
;
}
}
queue
.
push
(
ready_wrapper
);
if
(
gadget_instance
.
constructor
.
__ready_list
.
length
)
{
queue
=
new
RSVP
.
Queue
();
// Trigger calling of all ready callback
for
(
i
=
0
;
i
<
gadget_instance
.
constructor
.
__ready_list
.
length
;
i
+=
1
)
{
// Put a timeout?
queue
.
push
(
ready_executable_wrapper
(
gadget_instance
.
constructor
.
__ready_list
[
i
]
));
}
queue
.
push
(
ready_wrapper
);
return
queue
;
return
queue
;
}
return
ready_wrapper
();
});
});
})
})
.
declareMethod
(
'
getDeclaredGadget
'
,
.
declareMethod
(
'
getDeclaredGadget
'
,
...
...
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