Issue 6966

Replaces https://github.com/jquery/jquery-mobile/pull/7452 (pull in master instead of 1.4-stable)