fix viewport size on windows phone

This commit is contained in:
Robin Appelman 2014-02-20 18:42:59 +01:00
parent dde9193b2b
commit daf28225b7
1 changed files with 11 additions and 0 deletions

View File

@ -987,6 +987,17 @@ OC.set=function(name, value) {
context[tail]=value;
};
// fix device width on windows phone
(function() {
if ("-ms-user-select" in document.documentElement.style && navigator.userAgent.match(/IEMobile\/10\.0/)) {
var msViewportStyle = document.createElement("style");
msViewportStyle.appendChild(
document.createTextNode("@-ms-viewport{width:auto!important}")
);
document.getElementsByTagName("head")[0].appendChild(msViewportStyle);
}
})();
/**
* select a range in an input field
* @link http://stackoverflow.com/questions/499126/jquery-set-cursor-position-in-text-area