mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2025-04-19 13:32:24 +00:00
chore: make class to get the device form factor
This commit is contained in:
parent
510c35f450
commit
6f4eefe601
5 changed files with 11 additions and 6 deletions
|
@ -780,4 +780,10 @@ class LanguageManager {
|
|||
|
||||
return languageFilter.length > 0;
|
||||
}
|
||||
}
|
||||
|
||||
class DeviceUtils {
|
||||
static isMobile() {
|
||||
return window.innerWidth <= 768;
|
||||
}
|
||||
}
|
|
@ -1,6 +1,6 @@
|
|||
{{define "qrcodeModal"}}
|
||||
<a-modal id="qrcode-modal" v-model="qrModal.visible" :title="qrModal.title"
|
||||
:dialog-style="isMobileQr ? { top: '18px' } : {}"
|
||||
:dialog-style="DeviceUtils.isMobile() ? { top: '18px' } : {}"
|
||||
:closable="true"
|
||||
:class="themeSwitcher.currentTheme"
|
||||
:footer="null" width="fit-content">
|
||||
|
@ -35,7 +35,6 @@
|
|||
</a-modal>
|
||||
|
||||
<script>
|
||||
const isMobileQr = window.innerWidth <= 768;
|
||||
const qrModal = {
|
||||
title: '',
|
||||
dbInbound: new DBInbound(),
|
||||
|
|
|
@ -709,7 +709,7 @@
|
|||
showAlert: false,
|
||||
ipLimitEnable: false,
|
||||
pageSize: 50,
|
||||
isMobile: window.innerWidth <= 768,
|
||||
isMobile: DeviceUtils.isMobile(),
|
||||
},
|
||||
methods: {
|
||||
loading(spinning = true) {
|
||||
|
@ -1473,7 +1473,7 @@
|
|||
return false
|
||||
},
|
||||
onResize() {
|
||||
this.isMobile = window.innerWidth <= 768;
|
||||
this.isMobile = DeviceUtils.isMobile();
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
|
|
|
@ -601,7 +601,7 @@
|
|||
loadingTip: '{{ i18n "loading"}}',
|
||||
showAlert: false,
|
||||
showIp: false,
|
||||
isMobile: window.innerWidth <= 768
|
||||
isMobile: DeviceUtils.isMobile()
|
||||
},
|
||||
methods: {
|
||||
loading(spinning, tip = '{{ i18n "loading"}}') {
|
||||
|
|
|
@ -877,7 +877,7 @@
|
|||
refreshing: false,
|
||||
restartResult: '',
|
||||
showAlert: false,
|
||||
isMobile: window.innerWidth <= 768,
|
||||
isMobile: DeviceUtils.isMobile(),
|
||||
advSettings: 'xraySetting',
|
||||
obsSettings: '',
|
||||
cm: null,
|
||||
|
|
Loading…
Reference in a new issue