Skip to content

Commit

Permalink
Using mini buttons for edit/delete
Browse files Browse the repository at this point in the history
  • Loading branch information
nWidart committed Oct 29, 2017
1 parent 3a7edb0 commit 0188532
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 18 deletions.
26 changes: 13 additions & 13 deletions Modules/Core/Assets/js/components/DeleteComponent.vue
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
<template>
<el-button type="danger" @click="deleteRow" size="small"><i class="fa fa-trash"></i></el-button>
<el-button type="danger" @click="deleteRow" size="mini"><i class="fa fa-trash"></i></el-button>
</template>

<script>
export default {
props: {
rows: {default: null},
scope: {default: null},
rows: { default: null },
scope: { default: null },
},
data() {
return {
deleteMessage: '',
deleteTitle: '',
}
};
},
methods: {
deleteRow(event) {
Expand All @@ -22,35 +22,35 @@
type: 'warning',
confirmButtonClass: 'el-button--danger',
}).then(() => {
let vm = this;
const vm = this;
axios.delete(this.scope.row.urls.delete_url)
.then(response => {
.then((response) => {
if (response.data.errors === false) {
vm.$message({
type: 'success',
message: response.data.message
message: response.data.message,
});
vm.rows.splice(vm.scope.$index, 1);
}
})
.catch(error => {
.catch((error) => {
vm.$message({
type: 'error',
message: error.data.message
message: error.data.message,
});
});
}).catch(() => {
this.$message({
type: 'info',
message: this.trans('core.delete cancelled')
message: this.trans('core.delete cancelled'),
});
});
}
},
},
mounted() {
this.deleteMessage = this.trans('core.modal.confirmation-message');
this.deleteTitle = this.trans('core.modal.title');
}
}
},
};
</script>
6 changes: 3 additions & 3 deletions Modules/Core/Assets/js/components/EditButtonComponent.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<template>
<el-button
size="small"
size="mini"
@click.prevent="goToEditPage()">
<i class="fa fa-pencil"></i>
</el-button>
Expand All @@ -9,12 +9,12 @@
<script>
export default {
props: {
to: {type: Object, required: true}
to: { type: Object, required: true },
},
methods: {
goToEditPage() {
this.$router.push(this.to);
},
},
}
};
</script>
4 changes: 2 additions & 2 deletions public/js/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -117157,7 +117157,7 @@ var render = function() {
var _c = _vm._self._c || _h
return _c(
"el-button",
{ attrs: { type: "danger", size: "small" }, on: { click: _vm.deleteRow } },
{ attrs: { type: "danger", size: "mini" }, on: { click: _vm.deleteRow } },
[_c("i", { staticClass: "fa fa-trash" })]
)
}
Expand Down Expand Up @@ -117260,7 +117260,7 @@ var render = function() {
return _c(
"el-button",
{
attrs: { size: "small" },
attrs: { size: "mini" },
on: {
click: function($event) {
$event.preventDefault()
Expand Down

0 comments on commit 0188532

Please sign in to comment.