mirror of
https://github.com/Hopiu/jquery-mobile.git
synced 2026-03-16 22:10:25 +00:00
Merge remote branch 'origin/master'
This commit is contained in:
commit
08736c3dda
3 changed files with 26 additions and 1 deletions
|
|
@ -7,7 +7,11 @@
|
|||
|
||||
(function( $, undefined ) {
|
||||
|
||||
$.mobile.touchOverflowEnabled = true;
|
||||
// Enable touch overflow scrolling when it's natively supported
|
||||
$.mobile.touchOverflowEnabled = false;
|
||||
|
||||
// Enabled zoom when touch overflow is enabled. Can cause usability issues, unfortunately
|
||||
$.mobile.touchOverflowZoomEnabled = false;
|
||||
|
||||
$( document ).bind( "pagecreate", function( event ) {
|
||||
if( $.support.touchOverflow && $.mobile.touchOverflowEnabled ){
|
||||
|
|
|
|||
|
|
@ -103,6 +103,24 @@
|
|||
}
|
||||
}
|
||||
});
|
||||
|
||||
// This function injects a meta viewport tag to prevent scaling. Off by default, on by default when touchOverflow scrolling is enabled
|
||||
function disableZoom() {
|
||||
var cont = "user-scalable=no",
|
||||
meta = $( "meta[name='viewport']" );
|
||||
|
||||
if( meta.length ){
|
||||
meta.attr( "content", meta.attr( "content" ) + ", " + cont );
|
||||
}
|
||||
else{
|
||||
$( "head" ).prepend( "<meta>", { "name": "viewport", "content": cont } );
|
||||
}
|
||||
}
|
||||
|
||||
// if touch-overflow is enabled, disable user scaling, as it creates usability issues
|
||||
if( $.support.touchOverflow && $.mobile.touchOverflowEnabled && !$.mobile.touchOverflowZoomEnabled ){
|
||||
disableZoom();
|
||||
}
|
||||
|
||||
// initialize events now, after mobileinit has occurred
|
||||
$.mobile._registerInternalEvents();
|
||||
|
|
|
|||
|
|
@ -35,6 +35,9 @@
|
|||
-o-overflow-scrolling: touch;
|
||||
-ms-overflow-scrolling: touch;
|
||||
overflow-scrolling: touch;
|
||||
}
|
||||
.ui-page.ui-mobile-touch-overflow,
|
||||
.ui-page.ui-mobile-touch-overflow * {
|
||||
/* some level of transform keeps elements from blinking out of visibility on iOS */
|
||||
-webkit-transform: rotateY(0);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue