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:
parent
db7050512f
commit
5e9428a047
@ -7,7 +7,7 @@ const Plugin = {
|
||||
|
||||
Vue.prototype.$modal = {
|
||||
show(...args) {
|
||||
Plugin.modalContainer.add(...args);
|
||||
return Plugin.modalContainer.add(...args);
|
||||
},
|
||||
|
||||
hide(id) {
|
||||
|
@ -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,
|
||||
|
Loading…
Reference in New Issue
Block a user