blob: d4062f8c7e099435f0de1efbfd89788ea097b617 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
|
/**
* SPDX-FileCopyrightText: 2020 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later
*/
export default {
data() {
return {
isMobile: this._isMobile(),
}
},
beforeMount() {
window.addEventListener('resize', this._onResize)
},
beforeDestroy() {
window.removeEventListener('resize', this._onResize)
},
methods: {
_onResize() {
// Update mobile mode
this.isMobile = this._isMobile()
},
_isMobile() {
// check if content width is under 768px
return document.documentElement.clientWidth < 768
},
},
}
|