Skip to content

Commit c1e5139

Browse files
authored
Merge pull request #6739 from nextcloud/backport/6728/stable30
[stable30] fix(outline): fix mobile detection and box shadow
2 parents 71b17ce + 22c822d commit c1e5139

2 files changed

Lines changed: 11 additions & 24 deletions

File tree

src/components/Editor/EditorOutline.vue

Lines changed: 10 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
-->
55

66
<template>
7-
<div data-text-el="editor-outline" class="editor--outline" :class="{ 'editor--outline-mobile': mobile }">
7+
<div data-text-el="editor-outline" class="editor--outline" :class="{ 'editor--outline-mobile': $isMobile }">
88
<header class="editor--outline__header">
99
<NcButton class="editor--outline__btn-close"
1010
type="tertiary"
@@ -26,6 +26,7 @@ import TableOfContents from './TableOfContents.vue'
2626
import { useOutlineStateMixin, useOutlineActions } from './Wrapper.provider.js'
2727
import { Close } from './../icons.js'
2828
import useStore from '../../mixins/store.js'
29+
import { useIsMobileMixin } from '../Editor.provider.js'
2930
3031
export default {
3132
name: 'EditorOutline',
@@ -34,27 +35,12 @@ export default {
3435
NcButton,
3536
TableOfContents,
3637
},
37-
mixins: [useStore, useOutlineStateMixin, useOutlineActions],
38-
data: () => ({
39-
mobile: false,
40-
}),
41-
mounted() {
42-
this.$resizeObserver = new ResizeObserver(this.onResize)
43-
this.$resizeObserver.observe(this.$el.parentElement)
44-
this.onResize([this.$el.parentElement])
45-
},
46-
beforeDestroy() {
47-
this.$resizeObserver.unobserve(this.$el.parentElement)
48-
this.$resizeObserver = null
49-
this.$onResize = null
50-
},
51-
methods: {
52-
onResize([el]) {
53-
window.requestAnimationFrame(() => {
54-
this.mobile = el.clientWidth < 320
55-
})
56-
},
57-
},
38+
mixins: [
39+
useIsMobileMixin,
40+
useStore,
41+
useOutlineStateMixin,
42+
useOutlineActions,
43+
],
5844
}
5945
</script>
6046

@@ -68,7 +54,8 @@ export default {
6854
max-height: calc(100% - 204px);
6955
7056
&-mobile {
71-
box-shadow: 8px 0 17px -19px var(--color-box-shadow);
57+
border-radius: var(--border-radius-large);
58+
box-shadow: 0 1px 10px var(--color-box-shadow);
7259
background-color: var(--color-main-background-translucent);
7360
z-index: 1;
7461
}

src/components/Editor/Wrapper.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ export default {
8080
return false
8181
}
8282
83-
return this.viewWidth > 1265
83+
return true
8484
},
8585
},
8686

0 commit comments

Comments
 (0)