mirror of
https://github.com/frappe/books.git
synced 2024-12-24 20:00:29 +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 = {
|
Vue.prototype.$modal = {
|
||||||
show(...args) {
|
show(...args) {
|
||||||
Plugin.modalContainer.add(...args);
|
return Plugin.modalContainer.add(...args);
|
||||||
},
|
},
|
||||||
|
|
||||||
hide(id) {
|
hide(id) {
|
||||||
|
@ -5,9 +5,11 @@ export default function installFormModal(Vue) {
|
|||||||
Vue.mixin({
|
Vue.mixin({
|
||||||
computed: {
|
computed: {
|
||||||
$formModal() {
|
$formModal() {
|
||||||
|
let id;
|
||||||
|
|
||||||
const open = (doc, options = {}) => {
|
const open = (doc, options = {}) => {
|
||||||
const { defaultValues = null, onClose = null } = options;
|
const { defaultValues = null, onClose = null } = options;
|
||||||
this.$modal.show({
|
id = this.$modal.show({
|
||||||
component: Form,
|
component: Form,
|
||||||
props: {
|
props: {
|
||||||
doctype: doc.doctype,
|
doctype: doc.doctype,
|
||||||
@ -23,7 +25,7 @@ export default function installFormModal(Vue) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
const close = () => this.$modal.hide();
|
const close = () => this.$modal.hide(id);
|
||||||
|
|
||||||
return {
|
return {
|
||||||
open,
|
open,
|
||||||
|
Loading…
Reference in New Issue
Block a user