30 lines
759 B
JavaScript
30 lines
759 B
JavaScript
const TOOLBAR = document.getElementById("editbar")
|
|
|
|
if(TOOLBAR){
|
|
TOOLBAR.hidden = true
|
|
|
|
function init(){
|
|
const DOC = document.querySelector(`iframe[name="ace_outer"]`)?.contentDocument
|
|
.querySelector(`iframe[name="ace_inner"]`)?.contentDocument
|
|
?.getElementById("innerdocbody");
|
|
|
|
if(!DOC){
|
|
return setTimeout(init, 100);
|
|
}
|
|
|
|
console.log("Initialized toolbar hiding")
|
|
|
|
DOC.addEventListener("input", () => {
|
|
TOOLBAR.hidden = false
|
|
})
|
|
|
|
TOOLBAR.addEventListener("pointerenter", () => {
|
|
TOOLBAR.hidden = false
|
|
})
|
|
|
|
TOOLBAR.addEventListener("focusin", () => {
|
|
TOOLBAR.hidden = false
|
|
})
|
|
}
|
|
init()
|
|
} |