Skip to content

Commit

Permalink
Add option to open selection in new tabs
Browse files Browse the repository at this point in the history
fixes #895
  • Loading branch information
marcelklehr committed May 20, 2020
1 parent 45da16e commit e86437c
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion src/components/Breadcrumbs.vue
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,10 @@
<ActionButton icon="icon-delete" @click="onBulkDelete">
{{ t('bookmarks', 'Delete selection') }}
</ActionButton>
<ActionButton icon="icon-external" @click="onBulkOpen">
{{ t('bookmarks', 'Open all selected') }}
</ActionButton>
<ActionSeparator />
<ActionButton icon="icon-checkmark" @click="onSelectVisible">
{{ t('bookmarks', 'Select all visible') }}
</ActionButton>
Expand All @@ -80,11 +84,12 @@
import Multiselect from '@nextcloud/vue/dist/Components/Multiselect'
import Actions from '@nextcloud/vue/dist/Components/Actions'
import ActionButton from '@nextcloud/vue/dist/Components/ActionButton'
import ActionSeparator from '@nextcloud/vue/dist/Components/ActionSeparator'
import { actions, mutations } from '../store/'
export default {
name: 'Breadcrumbs',
components: { Multiselect, Actions, ActionButton },
components: { Multiselect, Actions, ActionButton, ActionSeparator },
props: {},
data() {
return {
Expand Down Expand Up @@ -168,6 +173,12 @@ export default {
})
},
async onBulkOpen() {
for (const { url } of this.$store.state.selection.bookmarks) {
window.open(url)
await new Promise(resolve => setTimeout(resolve, 200))
}
},
async onBulkDelete() {
await this.$store.dispatch(actions.DELETE_SELECTION, { folder: this.$route.params.folder })
this.$store.commit(mutations.RESET_SELECTION)
Expand Down

0 comments on commit e86437c

Please sign in to comment.