Skip to content

Commit

Permalink
use flexible in x5
Browse files Browse the repository at this point in the history
  • Loading branch information
rguanghui committed Apr 24, 2017
1 parent 7e10df9 commit 9224784
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 6 deletions.
5 changes: 3 additions & 2 deletions build/flexible.debug.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@
var isChrome = win.chrome;
var isIPhone = win.navigator.appVersion.match(/iphone/gi);
var devicePixelRatio = win.devicePixelRatio;
if (isIPhone || isChrome) {
var isX5 = /TBS\/\d+/.test(win.navigator.userAgent)
if (isIPhone || isChrome || isX5) {
// iOS下,对于2和3的屏,用2倍的方案,其余的用1倍方案
if (devicePixelRatio >= 3 && (!dpr || dpr >= 3)) {
dpr = 3;
Expand Down Expand Up @@ -115,4 +116,4 @@
return val;
}

})(window, window['lib'] || (window['lib'] = {}));
})(window, window['lib'] || (window['lib'] = {}));
2 changes: 1 addition & 1 deletion build/flexible.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion build/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "lib.flexible",
"description": "移动端自适应方案",
"version": "0.3.2",
"version": "1.0.0",
"homepage": "http://gitlab.alibaba-inc.com/mtb/lib-flexible",
"author": [
{
Expand Down
5 changes: 3 additions & 2 deletions src/flexible.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@
var isChrome = win.chrome;
var isIPhone = win.navigator.appVersion.match(/iphone/gi);
var devicePixelRatio = win.devicePixelRatio;
if (isIPhone || isChrome) {
var isX5 = /TBS\/\d+/.test(win.navigator.userAgent)
if (isIPhone || isChrome || isX5) {
// iOS下,对于2和3的屏,用2倍的方案,其余的用1倍方案
if (devicePixelRatio >= 3 && (!dpr || dpr >= 3)) {
dpr = 3;
Expand Down Expand Up @@ -115,4 +116,4 @@
return val;
}

})(window, window['lib'] || (window['lib'] = {}));
})(window, window['lib'] || (window['lib'] = {}));

0 comments on commit 9224784

Please sign in to comment.