minor asmjs build fixes
window event handling