mirror of
https://github.com/moodle/moodle.git
synced 2025-01-17 21:49:15 +01:00
MDL-43664 Javascript: Use YUI indexOf for pending_js tracking
Some old browsers do not support indexOf and so cannot determine whether JS script is in progress. The YUI Y.Array module polyfills the indexOf functionality when it does not exist.
This commit is contained in:
parent
12efa52762
commit
06acdf04f6
@ -718,7 +718,9 @@ M.util.js_watch_io();
|
||||
* @return boolean - True if there is any pending js.
|
||||
*/
|
||||
M.util.js_complete = function(uniqid) {
|
||||
var index = M.util.pending_js.indexOf(uniqid);
|
||||
// Use the Y.Array.indexOf instead of the native because some older browsers do not support
|
||||
// the native function. Y.Array polyfills the native function if it does not exist.
|
||||
var index = Y.Array.indexOf(M.util.pending_js, uniqid);
|
||||
if (index >= 0) {
|
||||
M.util.complete_js.push(M.util.pending_js.splice(index, 1));
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user