Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F4666
addOnloadHook_strict.patch
Public
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Authored By
•
bzimport
Nov 21 2014, 10:03 PM
2014-11-21 22:03:43 (UTC+0)
Size
700 B
Referenced Files
None
Subscribers
None
addOnloadHook_strict.patch
View Options
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
Details
Attached
Mime Type
text/x-diff
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
4231
Default Alt Text
addOnloadHook_strict.patch (700 B)
Attached To
Mode
T14773: JS: addOnloadHook() calls after runOnloadHook() fail
Attached
Detach File
Event Timeline
Log In to Comment