Fix 'online' event handling on Cordova