1
0
Fork 0
mirror of https://gitlab.com/bramw/baserow.git synced 2025-04-09 23:27:51 +00:00
bramw_baserow/web-frontend/mixins/context.js
2019-08-26 17:49:28 +00:00

25 lines
583 B
JavaScript

/**
* This mixin is for components that have the Context component as root element.
* It will make it easier to call the root context specific functions.
*/
export default {
methods: {
getRootContext() {
if (
this.$children.length > 0 &&
this.$children[0].$options.name === 'Context'
) {
return this.$children[0]
}
},
toggle(...args) {
this.getRootModal().toggle(...args)
},
show(...args) {
this.getRootModal().show(...args)
},
hide(...args) {
this.getRootModal().hide(...args)
}
}
}