prevent code text selection in firefox editor

stable
Juanfran 2017-03-10 09:45:59 +01:00
parent 423821f071
commit 7acae1d23b
1 changed files with 3 additions and 0 deletions

View File

@ -89,6 +89,9 @@ Medium = ($translate, $confirm, $storage, wysiwygService, animationFrame, tgLoad
pre.setAttribute('title', $translate.instant("COMMON.WYSIWYG.DB_CLICK"))
# prevent text selection in firefox
pre.addEventListener 'mousedown', (e) -> e.preventDefault()
if pre.nextElementSibling && pre.nextElementSibling.nodeName.toLowerCase() == 'p' && !pre.nextElementSibling.children.length
pre.nextElementSibling.appendChild(document.createElement('br'))