Add onSwap handler.

Hi Guillaume,

I faced an need to execute own functions after swap event. So I suggest to implement an option for such handler.

In particular is essential for widget overridden by some js wrapper. F.e CKeditor.