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
Ivan Tyagov
renderjs
Commits
2d73dbdb
Commit
2d73dbdb
authored
Jun 20, 2014
by
Romain Courteaud
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Speed up check if the element is attached to the DOM
parent
84717f1f
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
9 deletions
+1
-9
renderjs.js
renderjs.js
+1
-9
No files found.
renderjs.js
View file @
2d73dbdb
...
...
@@ -284,7 +284,6 @@
function
privateDeclareIframeGadget
(
url
,
options
,
parent_gadget
)
{
var
gadget_instance
,
iframe
,
node
,
iframe_loading_deferred
=
RSVP
.
defer
();
if
(
options
.
element
===
undefined
)
{
throw
new
Error
(
"
DOM element is required to create Iframe Gadget
"
+
...
...
@@ -292,14 +291,7 @@
}
// Check if the element is attached to the DOM
node
=
options
.
element
.
parentNode
;
while
(
node
!==
null
)
{
if
(
node
===
document
)
{
break
;
}
node
=
node
.
parentNode
;
}
if
(
node
===
null
)
{
if
(
!
document
.
contains
(
options
.
element
))
{
throw
new
Error
(
"
The parent element is not attached to the DOM for
"
+
url
);
}
...
...
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