I have a "wait screen" that is shown during javascript computations (these take 5-10s) in Cordova/PhoneGap 3.3. The wait screen is a DIV over whole screen that dims the view. My problem is when user swipes the wait screen, the whole application rolls to the side partially leaving the screen while printing following log message:
CordovaActivity: onMessage(onScrollChanged,org.apache.cordova.ScrollEvent@4207f0f0)
I guess this is because we trigger the wait screen with a help of window.setTimeout like this:
$("#wait-screen").show();
window.setTimeout(function() {
... code for computations ...
$("#wait-screen").hide();
}, 10);
Without the timout solution the DIV is not show at all and smallest working timeout value is 10ms. I blocked touchMove event in the whole document like this
document.addEventListener('touchmove', function(event) { event.preventDefault(); }, false);
The touchMove blocking works everywhere but not during the wait screen. I tried to add the EventListener to the wait screen DIV too but it did not block the move.
I suspect the timeout creates an extra javascript thread that stands apart the main application code and thus touchmove is not blocked there.
Can some one help with one of following? 1) do a wait screen without timeout or 2) effectively block touchmove during with timeout
Thanks.