Review Board 1.7.22

Call runOnLoadHandlers for URL gadgets

Review Request #6785 - Created Aug. 27, 2012 and submitted

Robert O'Neill
ddumont, rbaxter, ssievers
URL gadgets, unlike HTML gadgets, do not get rewritten by the server. This means that any load handlers that are registered in a url gadget will not be called. I modified core.onload to support URL gadgets. 

In cases where the script tag is statically written to the page, we can attach runOnLoadHandlers to the DOMContentLoaded event and to the window.onload event in case that we are using an older browser.

In cases where the script tag is dynamically inserted into the page by the url gadget code, core.onload must go out and find the script tag from which it was called. It must then attach runOnLoadHandlers to the script tag's onload event.

I also modified runOnLoadHandlers to only try to call registered load handlers if there actually are any load handlers that need to be run. Otherwise, we just ignore any additional calls.
Review request changed
Updated (Jan. 9, 2013, 3:04 p.m.)
  • changed from pending to submitted