Skip to content

Commit

Permalink
Close viewer on sidebar opening
Browse files Browse the repository at this point in the history
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
  • Loading branch information
skjnldsv committed Mar 1, 2019
1 parent 3609a21 commit a15bf7e
Showing 1 changed file with 10 additions and 24 deletions.
34 changes: 10 additions & 24 deletions src/views/Viewer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,6 @@ export default {
failed: false,

loading: true,
openedSidebar: false,

root: `/remote.php/dav/files/${OC.getCurrentUser().uid}`
}),
Expand All @@ -133,13 +132,15 @@ export default {
return ''
},
actions() {
return [
{
text: t('viewer', 'Share'),
icon: 'icon-share-white-forced',
action: this.showSharingSidebar
}
]
return OCA.Sharing
? [
{
text: t('viewer', 'Share'),
icon: 'icon-share-white-forced',
action: this.showSharingSidebar
}
]
: []
}
},

Expand Down Expand Up @@ -213,11 +214,6 @@ export default {
modal,
failed: false
}

// if the sidebar is already opened, change the current file
if (this.openedSidebar) {
OCA.Files.App.fileList.showDetailsView(this.currentFileName, 'shareTabView')
}
}

this.updatePreviousNext()
Expand Down Expand Up @@ -419,17 +415,7 @@ export default {
showSharingSidebar() {
// Open the sidebar sharing tab
OCA.Files.App.fileList.showDetailsView(this.currentFileName, 'shareTabView')

const sidebar = document.getElementById('app-sidebar')
const closeButton = sidebar.querySelector('.icon-close')

// Sidebar above the modal
sidebar.style.zIndex = 10001
this.openedSidebar = true
closeButton.addEventListener('click', e => {
sidebar.style.zIndex = null
this.openedSidebar = false
})
this.close()
}
}
}
Expand Down

0 comments on commit a15bf7e

Please sign in to comment.