Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-platform
Overview
Overview
Details
Activity
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
edx
edx-platform
Commits
d1cb8c14
Commit
d1cb8c14
authored
Aug 15, 2014
by
jmclaus
Committed by
Carson Gee
Aug 20, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Addressed comments.
(cherry picked from commit f85b0d0bc23ff4458a783302f3a6900bb08619e9)
parent
25e0627e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
6 deletions
+9
-6
common/static/js/capa/src/jsinput.js
+9
-6
No files found.
common/static/js/capa/src/jsinput.js
View file @
d1cb8c14
...
@@ -32,7 +32,7 @@ var JSInput = (function ($, undefined) {
...
@@ -32,7 +32,7 @@ var JSInput = (function ($, undefined) {
/* END Utils */
/* END Utils */
var
loadingTimeout
=
300
;
var
loadingTimeout
=
getLoadingTimeout
()
;
function
jsinputConstructor
(
elem
)
{
function
jsinputConstructor
(
elem
)
{
// Define an class that will be instantiated for each jsinput element
// Define an class that will be instantiated for each jsinput element
...
@@ -207,13 +207,17 @@ var JSInput = (function ($, undefined) {
...
@@ -207,13 +207,17 @@ var JSInput = (function ($, undefined) {
}
}
function
getLoadingTimeout
()
{
function
getLoadingTimeout
()
{
var
allSections
=
$
(
'section.jsinput'
),
timeout
;
var
allSections
=
$
(
'section.jsinput'
),
t
,
timeout
=
300
;
// Default value
allSections
.
each
(
function
(
index
,
value
)
{
allSections
.
each
(
function
(
index
,
value
)
{
t
imeout
=
$
(
value
).
attr
(
"data-loading-timeout"
);
t
=
$
(
value
).
attr
(
"data-loading-timeout"
);
if
(
t
imeout
&&
isFinite
(
timeou
t
))
{
if
(
t
&&
isFinite
(
t
))
{
loadingTimeout
=
Math
.
max
(
loadingTimeou
t
,
timeout
);
timeout
=
Math
.
max
(
t
,
timeout
);
}
}
});
});
return
timeout
;
}
}
// This is ugly, but without a timeout pages with multiple/heavy jsinputs
// This is ugly, but without a timeout pages with multiple/heavy jsinputs
...
@@ -221,7 +225,6 @@ var JSInput = (function ($, undefined) {
...
@@ -221,7 +225,6 @@ var JSInput = (function ($, undefined) {
// 300 ms is arbitrary but this has functioned with the only application
// 300 ms is arbitrary but this has functioned with the only application
// that has ever used JSInput, jsVGL. Something more sturdy should be put in
// that has ever used JSInput, jsVGL. Something more sturdy should be put in
// place.
// place.
getLoadingTimeout
();
if
(
$
.
isReady
)
{
if
(
$
.
isReady
)
{
setTimeout
(
walkDOM
,
loadingTimeout
);
setTimeout
(
walkDOM
,
loadingTimeout
);
}
else
{
}
else
{
...
...
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