Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

address @spicyj's code review comments: more commenting and check aga…

…inst null instead of `typeof ... "undefined"`
  • Loading branch information...
commit e7fa93cc2ae49d1966aead8e4f5142ee9277b33a 1 parent f083f55
@divad12 divad12 authored
Showing with 3 additions and 1 deletion.
  1. +3 −1 khan-exercise.js
View
4 khan-exercise.js
@@ -2458,9 +2458,11 @@ var Khan = (function() {
// 4) now B finishes updating X and overwrites A(X) with B(X)
// ...when what we actually wanted saved is B(A(X)). We should really fix it
// on the server by running the hint and attempt requests in transactions.
- if ( typeof queue !== "undefined" ) {
+ if ( queue != null ) {
+ // Create an empty jQuery object to use as a queue holder, if needed.
requestQueue[queue] = requestQueue[queue] || jQuery( {} );
+ // Queue up sending the request to run when old requests have completed.
requestQueue[queue].queue(function(next) {
sendRequest().always( next );
});
Please sign in to comment.
Something went wrong with that request. Please try again.