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

Add more close options to file actions menu #2161

Merged
merged 1 commit into from
Oct 8, 2019
Merged
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
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>