Skip to content

Commit

Permalink
feat(component): add editModal and addModal save click events
Browse files Browse the repository at this point in the history
  • Loading branch information
Walker Leite committed Jan 24, 2018
1 parent e77d7aa commit aa06d91
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions src/ic-crud-dropdown/ic-crud-dropdown.vue
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@
<template slot="modal-footer">
<b-button
variant="success"
@click="$refs.addForm.submit()">
@click="onAddModalSaveClick">
<i class="fa fa-check"></i>
{{ txtSaveButton }}
</b-button>
Expand All @@ -102,7 +102,7 @@
<template slot="modal-footer">
<b-button
variant="success"
@click="$refs.editForm.submit()">
@click="onEditModalSaveClick">
<i class="fa fa-check"></i>
{{ txtSaveButton }}
</b-button>
Expand Down Expand Up @@ -287,6 +287,13 @@ export default {
this.editingItem = item
this.$refs.editModal.show();
},
onEditModalSaveClick() {
/**
* When user click in save button on the edit modal
*/
this.$emit('editModal-save-click')
this.$refs.editForm.submit()
},
onEditFormSubmission(item) {
this.$refs.dropdown.hide();
this.$refs.editModal.hide();
Expand All @@ -297,6 +304,13 @@ export default {
*/
this.$emit('update', {item, id: this.getItemId(item)});
},
onAddModalSaveClick() {
/**
* When user click in save button on the add modal
*/
this.$emit('addModal-save-click')
this.$refs.addForm.submit()
},
onAddFormSubmission(item) {
this.$refs.dropdown.hide();
this.$refs.addModal.hide();
Expand Down

0 comments on commit aa06d91

Please sign in to comment.