2
0
mirror of https://github.com/frappe/books.git synced 2024-12-23 19:39:07 +00:00

Return modal id in modal.show

This commit is contained in:
Faris Ansari 2018-09-28 18:42:34 +05:30
parent db7050512f
commit 5e9428a047
3 changed files with 6 additions and 4 deletions

View File

@ -7,7 +7,7 @@ const Plugin = {
Vue.prototype.$modal = {
show(...args) {
Plugin.modalContainer.add(...args);
return Plugin.modalContainer.add(...args);
},
hide(id) {

View File

@ -5,9 +5,11 @@ export default function installFormModal(Vue) {
Vue.mixin({
computed: {
$formModal() {
let id;
const open = (doc, options = {}) => {
const { defaultValues = null, onClose = null } = options;
this.$modal.show({
id = this.$modal.show({
component: Form,
props: {
doctype: doc.doctype,
@ -23,7 +25,7 @@ export default function installFormModal(Vue) {
});
}
const close = () => this.$modal.hide();
const close = () => this.$modal.hide(id);
return {
open,