Page MenuHomePhabricator

addOnloadHook_strict.patch

Authored By
bzimport
Nov 21 2014, 10:03 PM
Size
700 B
Referenced Files
None
Subscribers
None

addOnloadHook_strict.patch

Index: skins/common/wikibits.js
===================================================================
--- skins/common/wikibits.js (revision 32923)
+++ skins/common/wikibits.js (working copy)
@@ -25,9 +25,13 @@
var onloadFuncts = [];
}
-function addOnloadHook(hookFunct) {
- // Allows add-on scripts to add onload functions
- onloadFuncts[onloadFuncts.length] = hookFunct;
+function addOnloadHook(hookFunct, strict) {
+ // Allows add-on scripts to add onload functions
+ if(!doneOnloadHook) {
+ onloadFuncts[onloadFuncts.length] = hookFunct;
+ } else if(!strict) {
+ hookFunct(); // for calls after runOnloadHooks ran
+ }
}
function hookEvent(hookName, hookFunct) {

File Metadata

Mime Type
text/x-diff
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
4231
Default Alt Text
addOnloadHook_strict.patch (700 B)

Event Timeline