2
0
mirror of https://github.com/frappe/books.git synced 2024-11-10 15:50:56 +00:00
books/ui/components/Modal/plugin.js
thefalconx33 79b99055e0 - Custom doc for Report Filters
- frappe.showModal
- Custom textarea rows
2019-07-30 17:24:27 +05:30

28 lines
583 B
JavaScript

import ModalContainer from './ModalContainer';
import frappe from 'frappejs';
const Plugin = {
install(Vue) {
this.event = new Vue();
Vue.prototype.$modal = {
show(...args) {
return Plugin.modalContainer.add(...args);
},
hide(id) {
Plugin.event.$emit('hide', id);
}
};
frappe.showModal = Vue.prototype.$modal.show;
// create modal container
const div = document.createElement('div');
document.body.appendChild(div);
new Vue({ render: h => h(ModalContainer) }).$mount(div);
}
};
export default Plugin;