Incam_PROFIND_Web/www/themes/profind/js/ios-orientationchange-fix.js
roberto 1e044b6498 Subida inicial.
Funciona:
- Usuario
- Empresa

git-svn-id: https://192.168.0.254/svn/Proyectos.Incam_PROFIND_Web/trunk@2 3fe1ab16-cfe0-e34b-8c9f-7d8c168d430d
2012-09-20 19:38:42 +00:00

5 lines
893 B
JavaScript

/*! A fix for the iOS orientationchange zoom bug.
Script by @scottjehl, rebound by @wilto.
MIT License.
*/
/*! A fix for the iOS orientationchange zoom bug. Script by @scottjehl, rebound by @wilto.MIT License.*/(function(a){function l(){c.setAttribute("content",f),g=!0}function m(){c.setAttribute("content",e),g=!1}function n(b){k=b.accelerationIncludingGravity,h=Math.abs(k.x),i=Math.abs(k.y),j=Math.abs(k.z),(!a.orientation||a.orientation===180)&&(h>7||(j>6&&i<8||j<8&&i>6)&&h>5)?g&&m():g||l()}if(!(/iPhone|iPad|iPod/.test(navigator.platform)&&navigator.userAgent.indexOf("AppleWebKit")>-1))return;var b=a.document;if(!b.querySelector)return;var c=b.querySelector("meta[name=viewport]"),d=c&&c.getAttribute("content"),e=d+",maximum-scale=1",f=d+",maximum-scale=10",g=!0,h,i,j,k;if(!c)return;a.addEventListener("orientationchange",l,!1),a.addEventListener("devicemotion",n,!1)})(this);