1
0

re-renamed addLoadEvent

This commit is contained in:
Garvin Hicking
2014-03-06 16:00:20 +01:00
parent a9505b4d2f
commit a5bd6563dd
2 changed files with 14 additions and 14 deletions

@ -279,7 +279,7 @@ if (parent.frames && parent.frames['tree']) {
tree.draw();
}
serendipity.addLoadEvent(treeInit);
addLoadEvent(treeInit);
</script>
{/if}
</body>

@ -41,19 +41,6 @@
return null;
}
// Some sort of onload wrapper? @onli says jQuery can help with this
serendipity.addLoadEvent = function(func) {
var oldonload = window.onload;
if (typeof window.onload != 'function') {
window.onload = func;
} else {
window.onload = function() {
oldonload();
func();
}
}
}
/**
* Based upon code written by chris wetherell
* http://www.massless.org
@ -1203,4 +1190,17 @@ var AccessifyHTML5 = function (defaults, more_fixes) {
});
})(jQuery);
// This is kept for older plugins. Use of $(document).ready() is encouraged.
// At some point, this will be removed.
addLoadEvent = function(func) {
var oldonload = window.onload;
if (typeof window.onload != 'function') {
window.onload = func;
} else {
window.onload = function() {
oldonload();
func();
}
}
}