Ajout du auto hiding de la toolbar
This commit is contained in:
2 files changed
+39
No files matched your search
@@ -0,0 +1,30 @@
|
||||
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()
|
||||
}
|
||||
Reference in new issue
Block a user