mirror of
https://github.com/kuaifan/dootask.git
synced 2025-12-13 12:02:51 +00:00
fix: 部分pad设备横版和竖屏反过来
This commit is contained in:
parent
4ff1cf68fc
commit
d06d1c177c
6
resources/assets/js/functions/common.js
vendored
6
resources/assets/js/functions/common.js
vendored
@ -552,14 +552,14 @@ const localforage = require("localforage");
|
|||||||
* @returns {string}
|
* @returns {string}
|
||||||
*/
|
*/
|
||||||
screenOrientation() {
|
screenOrientation() {
|
||||||
try {
|
/*try {
|
||||||
if (typeof window.screen.orientation === "object") {
|
if (typeof window.screen.orientation === "object") {
|
||||||
return $A.strExists(window.screen.orientation.type, 'portrait') ? 'portrait' : 'landscape'
|
return $A.strExists(window.screen.orientation.type, 'portrait') ? 'portrait' : 'landscape'
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
//
|
//
|
||||||
}
|
}*/ // 注释原因:有些设备宽和高对调了
|
||||||
return $A(window).width() > $A(window).height() ? "landscape" : "portrait"
|
return $A(window).width() - $A(window).height() > 50 ? "landscape" : "portrait"
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user