Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
coopwire-hypothesis
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
孙灵跃 Leon Sun
coopwire-hypothesis
Commits
44395004
Commit
44395004
authored
Jun 27, 2017
by
Juan Corona
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rename FrameUtil.isReady to .isDocumentReady
Better differentiation from .isLoaded
parent
e7d6d83b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
3 deletions
+3
-3
frame-observer.js
src/annotator/frame-observer.js
+1
-1
frame-util.js
src/annotator/util/frame-util.js
+2
-2
No files found.
src/annotator/frame-observer.js
View file @
44395004
...
@@ -38,7 +38,7 @@ class FrameObserver {
...
@@ -38,7 +38,7 @@ class FrameObserver {
_addFrame
(
frame
)
{
_addFrame
(
frame
)
{
if
(
FrameUtil
.
isAccessible
(
frame
))
{
if
(
FrameUtil
.
isAccessible
(
frame
))
{
FrameUtil
.
isReady
(
frame
,
()
=>
{
FrameUtil
.
is
Document
Ready
(
frame
,
()
=>
{
frame
.
contentWindow
.
addEventListener
(
'unload'
,
()
=>
{
frame
.
contentWindow
.
addEventListener
(
'unload'
,
()
=>
{
this
.
_removeFrame
(
frame
);
this
.
_removeFrame
(
frame
);
});
});
...
...
src/annotator/util/frame-util.js
View file @
44395004
...
@@ -43,7 +43,7 @@ function isValid (iframe) {
...
@@ -43,7 +43,7 @@ function isValid (iframe) {
return
iframe
.
className
!==
'h-sidebar-iframe'
;
return
iframe
.
className
!==
'h-sidebar-iframe'
;
}
}
function
isReady
(
iframe
,
callback
)
{
function
is
Document
Ready
(
iframe
,
callback
)
{
if
(
iframe
.
contentDocument
.
readyState
===
'loading'
)
{
if
(
iframe
.
contentDocument
.
readyState
===
'loading'
)
{
iframe
.
contentDocument
.
addEventListener
(
'DOMContentLoaded'
,
function
()
{
iframe
.
contentDocument
.
addEventListener
(
'DOMContentLoaded'
,
function
()
{
callback
();
callback
();
...
@@ -70,5 +70,5 @@ module.exports = {
...
@@ -70,5 +70,5 @@ module.exports = {
isAccessible
:
isAccessible
,
isAccessible
:
isAccessible
,
isValid
:
isValid
,
isValid
:
isValid
,
isLoaded
:
isLoaded
,
isLoaded
:
isLoaded
,
is
Ready
:
is
Ready
,
is
DocumentReady
:
isDocument
Ready
,
};
};
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