1
0
Fork 0
mirror of https://gitlab.com/bramw/baserow.git synced 2025-04-16 18:07:47 +00:00
bramw_baserow/web-frontend/directives/moveToBody.js

18 lines
458 B
JavaScript

/**
* This directive moves the whole element to the document body so that it can be
* positioned over another element.
*/
export default {
inserted: el => {
const body = document.body
// The element is added as first child in the body so that child contexts
// are being shown on top of their parent.
body.insertBefore(el, body.firstChild)
},
unbind: el => {
if (el.parentNode) {
el.parentNode.removeChild(el)
}
}
}