Merge branch 'MDL-43664-master' of git://github.com/andrewnicols/moodle

This commit is contained in:
Dan Poltawski 2014-01-14 16:50:07 +08:00
commit 473924dfd5

View file

@ -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));
}