Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: don't close sidebar when clicking outside #2785

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 14 additions & 9 deletions src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ License along with this library. If not, see <http://www.gnu.org/licenses/>.

<template>
<NcContent app-name="tasks">
<AppNavigation @click="closeAppSidebar($event)" />
<AppNavigation />

<NcAppContent @click="closeAppSidebar($event)">
<NcAppContent @click="closeAppNavigation">
<RouterView />
</NcAppContent>

Expand All @@ -41,6 +41,7 @@ import NcAppContent from '@nextcloud/vue/components/NcAppContent'
import NcContent from '@nextcloud/vue/components/NcContent'

import { mapGetters } from 'vuex'
import { useIsMobile } from '@nextcloud/vue'

export default {
name: 'App',
Expand All @@ -50,6 +51,12 @@ export default {
NcContent,
},
inject: ['$OCA'],
setup() {
const isMobile = useIsMobile()
return {
isMobile,
}
},
data() {
return {
searchString: '',
Expand Down Expand Up @@ -102,7 +109,7 @@ export default {
* Fetch the tasks of each calendar
*/
fetchTasks() {
// wait for all calendars to have fetch their tasks
// wait for all calendars to have fetched their tasks
Promise.all(this.calendars.map(calendar =>
this.$store.dispatch('getTasksFromCalendar', { calendar, completed: false, related: null }),
)).then(() => {
Expand All @@ -111,13 +118,11 @@ export default {
},

/**
* Close the details view
*
* @param {object} $event the event
* Close the app navigation on mobile devices
*/
closeAppSidebar($event) {
if (!($event.target.closest('.reactive') || $event.target.classList.contains('reactive')) && this.$route.params.taskId) {
emit('tasks:close-appsidebar')
closeAppNavigation() {
if (this.isMobile) {
emit('toggle-navigation', { open: false })
}
},
filterProxy({ query }) {
Expand Down
Loading