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

Allow to close the actions menu after click #622

Merged
merged 3 commits into from
Oct 3, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
2 changes: 1 addition & 1 deletion src/components/ActionButton/ActionButton.vue
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ This component is made to be used inside of the [Actions](#Actions) component sl
```vue
<Actions>
<ActionButton icon="icon-delete" @click="alert('Delete')">Delete</ActionButton>
<ActionButton icon="icon-delete" @click="alert('Delete')">Delete</ActionButton>
<ActionButton icon="icon-delete" :close-after-click="true" @click="alert('Delete and close menu')">Delete and close</ActionButton>
<ActionButton icon="icon-delete" :disabled="true" @click="alert('Disabled')">Disabled button</ActionButton>
</Actions>
```
Expand Down
11 changes: 11 additions & 0 deletions src/mixins/actionText.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,13 @@ export default {
title: {
type: String,
default: ''
},
/**
* Whether we close the Actions menu after the click
*/
closeAfterClick: {
type: Boolean,
default: false
}
},

Expand All @@ -59,6 +66,10 @@ export default {
* @type {Event}
*/
this.$emit('click', event)

if (this.closeAfterClick) {
this.$parent.closeMenu()
raimund-schluessler marked this conversation as resolved.
Show resolved Hide resolved
}
}
}
}