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'
2626import { useOutlineStateMixin , useOutlineActions } from ' ./Wrapper.provider.js'
2727import { Close } from ' ./../icons.js'
2828import useStore from ' ../../mixins/store.js'
29+ import { useIsMobileMixin } from ' ../Editor.provider.js'
2930
3031export 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 }
0 commit comments