Add:Device setting for locking screen orientation #449

This commit is contained in:
advplyr 2022-12-04 10:41:09 -06:00
parent af216d9b38
commit 9687f47b6b
12 changed files with 100 additions and 7 deletions

View file

@ -156,6 +156,16 @@ Vue.prototype.$encode = encode
const decode = (text) => Buffer.from(decodeURIComponent(text), 'base64').toString()
Vue.prototype.$decode = decode
Vue.prototype.$setOrientationLock = (orientationLockSetting) => {
if (orientationLockSetting == 'PORTRAIT') {
window.screen.orientation.lock('portrait')
} else if (orientationLockSetting == 'LANDSCAPE') {
window.screen.orientation.lock('landscape')
} else {
window.screen.orientation.unlock()
}
}
export default ({ store, app }) => {
// iOS Only
// backButton event does not work with iOS swipe navigation so use this workaround