Files
Fuchs_Intranet/Fuchs/web/loadcss/onloadCSS.js
T

30 lines
846 B
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
/*! onloadCSS. (onload callback for loadCSS) [c]2017 Filament Group, Inc. MIT License */
/* global navigator */
/* exported onloadCSS */
function onloadCSS( ss, callback ) {
var called;
function newcb(){
if( !called && callback ){
called = true;
callback.call( ss );
}
}
if( ss.addEventListener ){
ss.addEventListener( "load", newcb );
}
if( ss.attachEvent ){
ss.attachEvent( "onload", newcb );
}
// This code is for browsers that dont support onload
// No support for onload (it'll bind but never fire):
// * Android 4.3 (Samsung Galaxy S4, Browserstack)
// * Android 4.2 Browser (Samsung Galaxy SIII Mini GT-I8200L)
// * Android 2.3 (Pantech Burst P9070)
// Weak inference targets Android < 4.4
if( "isApplicationInstalled" in navigator && "onloadcssdefined" in ss ) {
ss.onloadcssdefined( newcb );
}
}