Skip to content

Commit

Permalink
Merge pull request #2161 from owncloud/bugfix/actions-menu
Browse files Browse the repository at this point in the history
Add more close options to file actions menu
  • Loading branch information
Vincent Petry authored Oct 8, 2019
2 parents 88d926b + 2f60d78 commit 4f25248
Showing 1 changed file with 22 additions and 7 deletions.
29 changes: 22 additions & 7 deletions apps/files/src/components/FileActions.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
<template>
<div v-if="isOpen" :id="id" uk-offcanvas="mode: slide" class="oc-file-actions uk-offcanvas-bottom uk-open" style="display: block !important;">
<div class="uk-offcanvas-bar">
<span v-text="_label"></span>
<oc-button
icon="close"
class="uk-position-top-right uk-position-absolute uk-margin-top uk-margin-right"
@click="closeActions"
aria-label="$_closeActionsButtonLabel"
/>
<div v-text="$_label" class="uk-margin-small-bottom" />
<ul class="uk-nav">
<li v-for="(action, i) in actions" :key="i">
<a class="uk-inline" @click="selectAction(action)">
Expand Down Expand Up @@ -30,6 +36,21 @@ export default {
isOpen: false
}
},
computed: {
$_label () {
const translated = this.$gettext('Open %{fileName} in')
return this.$gettextInterpolate(translated, { fileName: this.filename })
},
$_closeActionsButtonLabel () {
return this.$gettext('Close file actions menu')
}
},
watch: {
$route () {
this.closeActions()
}
},
mounted () {
this.$root.$on('oc-file-actions:open', file => {
this.showActions(file)
Expand All @@ -50,12 +71,6 @@ export default {
this.closeActions()
action.onClick()
}
},
computed: {
_label () {
const translated = this.$gettext('Open %{fileName} in')
return this.$gettextInterpolate(translated, { fileName: this.filename })
}
}
}
</script>

0 comments on commit 4f25248

Please sign in to comment.