Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
D
drupal
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Custom Issue Tracker
Custom Issue Tracker
Labels
Merge Requests
306
Merge Requests
306
Requirements
Requirements
List
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Analytics
Analytics
Code Review
Insights
Issue
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
project
drupal
Commits
d4ad3657
Commit
d4ad3657
authored
Jan 12, 2006
by
Steven Wittens
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
-
#44299
: Avoid possible race condition with 0-delay progressbar monitoring
parent
cccca3b1
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
2 deletions
+8
-2
misc/progress.js
misc/progress.js
+8
-2
No files found.
misc/progress.js
View file @
d4ad3657
...
...
@@ -60,6 +60,8 @@ progressBar.prototype.startMonitoring = function (uri, delay) {
*/
progressBar
.
prototype
.
stopMonitoring
=
function
()
{
clearTimeout
(
this
.
timer
);
// This allows monitoring to be stopped from within the callback
this
.
uri
=
null
;
}
/**
...
...
@@ -69,7 +71,9 @@ progressBar.prototype.sendPing = function () {
if
(
this
.
timer
)
{
clearTimeout
(
this
.
timer
);
}
this
.
method
(
this
.
uri
,
this
.
receivePing
,
this
,
''
);
if
(
this
.
uri
)
{
this
.
method
(
this
.
uri
,
this
.
receivePing
,
this
,
''
);
}
}
/**
...
...
@@ -82,8 +86,10 @@ progressBar.prototype.receivePing = function (string, xmlhttp, pb) {
}
// Split into values
var
matches
=
string
.
length
>
0
?
string
.
split
(
'
|
'
)
:
[];
pb
.
timer
=
setTimeout
(
function
()
{
pb
.
sendPing
();
},
pb
.
delay
);
// Update progress
if
(
matches
.
length
>=
2
)
{
pb
.
setProgress
(
matches
[
0
],
matches
[
1
]);
}
// Schedule next timer
pb
.
timer
=
setTimeout
(
function
()
{
pb
.
sendPing
();
},
pb
.
delay
);
}
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