I cannot access window content inside OK callback function. It is because window is closed before. So, I cannot read form values on the window, for example.
Fix is easy, call callback first and then close window. Line 48 should be like:
var cb = function() { callback(); self.close(); };
Thank you!