Skip to content

Instantly share code, notes, and snippets.

@davglass
Created January 13, 2012 15:02
Show Gist options
  • Save davglass/1606825 to your computer and use it in GitHub Desktop.
Save davglass/1606825 to your computer and use it in GitHub Desktop.
YUI 3.3.0 FF 9 Duplicate Script Loading Patch
(function() {
/*
* This patch fixes an issue with Y.Get in 3.2.0 & 3.3.0
* where it fails to know when a CSS file is loaded in FF 9+.
* Since it fails to know when the load of the CSS file
* has completed, it creates a race condition that
* forces the scripts to be attached again.
*/
if (typeof YUI_config === 'undefined') {
YUI_config = {};
}
var originalGecko;
YUI_config.onProgress = function() {
var Y = this;
originalGecko = Y.UA.gecko;
if (originalGecko > 8) {
Y.UA.gecko = false;
}
};
YUI_config.onEnd = function() {
var Y = this;
if (originalGecko) {
Y.UA.gecko = originalGecko;
}
}
}());
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment