Apply JS formatter

This commit is contained in:
Aljaž Grilc 2024-02-07 09:08:53 +01:00
parent f3f37fff02
commit dd5a6ff85b

View File

@ -7,11 +7,7 @@ class BesEditor {
this.children = []
this.correctionPanel = document.getElementById('correction-panel') // TODO: use document.createElement('div') and insert it before edit element in DOM.
this.proof(edit)
edit.addEventListener(
'beforeinput',
e => this.handleBeforeInput(e),
false
)
edit.addEventListener('beforeinput', e => this.handleBeforeInput(e), false)
edit.addEventListener('click', e => this.handleClick(e))
}
@ -72,7 +68,10 @@ class BesEditor {
/*startingOffset <= match.offset &&*/ match.offset <
startingOffset + data[idx].text.length
) {
range.setStart(data[idx].el, match.offset - startingOffset)
range.setStart(
data[idx].el,
match.offset - startingOffset
)
break
}
}
@ -231,7 +230,8 @@ class BesEditor {
// Returns first block parent element
getBlockParent(el) {
for (; el && el !== this.el; el = el.parentNode) {
if (el.nodeType === Node.ELEMENT_NODE && BesEditor.isBlockElement(el)) return el
if (el.nodeType === Node.ELEMENT_NODE && BesEditor.isBlockElement(el))
return el
}
return el
}