Skip to content

Commit

Permalink
Passing the translations to the child delete component.
Browse files Browse the repository at this point in the history
  • Loading branch information
nWidart committed Sep 12, 2017
1 parent 6e1de80 commit 4decbe6
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Modules/Page/Assets/js/components/PageTable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<template scope="scope">
<a class="btn btn-default btn-flat" @click.prevent="goToEdit(scope)"><i class="fa fa-pencil"></i></a>

<delete-button :scope="scope" :rows="data">
<delete-button :scope="scope" :rows="data" :translations="translations">
</delete-button>
</template>
</el-table-column>
Expand Down
24 changes: 19 additions & 5 deletions public/js/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -69077,25 +69077,33 @@ module.exports = Component.exports

"use strict";
Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__Core_Assets_js_mixins_Translate__ = __webpack_require__(121);
//
//
//
//


/* harmony default export */ __webpack_exports__["default"] = ({
mixins: [__WEBPACK_IMPORTED_MODULE_0__Core_Assets_js_mixins_Translate__["a" /* default */]],
props: {
deleteMessage: { default: "Are you sure you want to delete this record?" },
deleteTitle: { default: "Confirmation" },
rows: { default: null },
scope: { default: null }
},
data: function data() {
return {
deleteMessage: '',
deleteTitle: ''
};
},

methods: {
deleteRow: function deleteRow(event) {
var _this = this;

this.$confirm(this.deleteMessage, this.deleteTitle, {
confirmButtonText: 'OK',
cancelButtonText: 'Cancel',
confirmButtonText: this.translate('core', 'button.delete'),
cancelButtonText: this.translate('core', 'button.cancel'),
type: 'warning'
}).then(function () {
var vm = _this;
Expand All @@ -69115,12 +69123,17 @@ Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
});
});
}).catch(function () {
console.log('asdasd');
_this.$message({
type: 'info',
message: 'Delete canceled'
});
});
}
},
mounted: function mounted() {
this.deleteMessage = this.translate('core', 'modal.confirmation-message');
this.deleteTitle = this.translate('core', 'modal.title');
}
});

Expand Down Expand Up @@ -69307,7 +69320,8 @@ module.exports={render:function (){var _vm=this;var _h=_vm.$createElement;var _c
})]), _vm._v(" "), _c('delete-button', {
attrs: {
"scope": scope,
"rows": _vm.data
"rows": _vm.data,
"translations": _vm.translations
}
})]
}
Expand Down

0 comments on commit 4decbe6

Please sign in to comment.