diff --git a/app/assets/javascripts/02-editor.js b/app/assets/javascripts/02-editor.js index b95fe177..5d383cf7 100644 --- a/app/assets/javascripts/02-editor.js +++ b/app/assets/javascripts/02-editor.js @@ -242,7 +242,8 @@ function hasContent (element) { if (element.tagName === "IMG" || element.tagName === "AUDIO" || element.tagName === "VIDEO" - || element.tagName === "IFRAME") return true + || element.tagName === "IFRAME" + || element.tagName === "BR") return true return false } @@ -433,16 +434,6 @@ function setupEditor (editorEl) { const contentEl = editorEl.querySelector(".editor-content") - contentEl.addEventListener("keydown", event => { - if (event.keyCode === 32) { // Espacio - event.preventDefault() - const sel = window.getSelection() - const range = sel.getRangeAt(0) - range.insertNode(document.createTextNode("\xa0")) - cleanContent(contentEl) - range.collapse() - } - }) contentEl.addEventListener("paste", event => { editorEl.querySelector(".editor-aviso-word").style.display = "block" })