ZF-8108: addOnUNload action is needed


If there is an addOnLoad method, addOnUnload method would be nice too. Easy to implement, but handy.


Attached is a patch that includes an implementation of addOnUnload and the unit tests to support it.

Cant you just call?

$this->jQuery->addJavascript('$(window).unload(function() {

The addOnLoad() stuff is necessary to aggregate all on load calls into one single statement. I am not an expert, but do you need unload events on many different elements or is it mostly one event per request?