From 434bb4a6f1de2552c6fd6d4bcc97a7dfd2f853c6 Mon Sep 17 00:00:00 2001 From: f Date: Wed, 18 Nov 2020 13:38:24 -0300 Subject: [PATCH] cargar la imagen de placeholder --- app/assets/javascripts/01-types.js | 4 ++-- app/assets/javascripts/02-editor.js | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/app/assets/javascripts/01-types.js b/app/assets/javascripts/01-types.js index e5bd2594..c57a9cdc 100644 --- a/app/assets/javascripts/01-types.js +++ b/app/assets/javascripts/01-types.js @@ -87,7 +87,7 @@ const blocks = { selector: "IMG", createFn: editorEl => { const el = document.createElement("IMG") - el.src = "/public/placeholder.png" + el.src = "/placeholder.png" el.alt = "" return el }, @@ -118,7 +118,7 @@ const blocks = { selector: "VIDEO", createFn: editorEl => { const el = document.createElement("VIDEO") - el.poster = "/public/placeholder.png" + el.poster = "/placeholder.png" // Para poder seleccionar el video tenemos que sacarle los // controles, pero queremos poder verlos para reproducir el video. // Al hacer click le damos los controles y al salir se los sacamos diff --git a/app/assets/javascripts/02-editor.js b/app/assets/javascripts/02-editor.js index 638e55c9..5bded209 100644 --- a/app/assets/javascripts/02-editor.js +++ b/app/assets/javascripts/02-editor.js @@ -330,7 +330,7 @@ function cleanNode (node, contentEl) { if (child.getAttribute("hspace")) child.removeAttribute("hspace") if (child.align.length) child.removeAttribute("align") if (child.name.length) child.removeAttribute("name") - if (!child.src.length) child.src = "/public/placeholder.png" + if (!child.src.length) child.src = "/placeholder.png" } else if (child.tagName === "FONT") { moveChildren(child, child.parentElement, child.nextSiling) child.parentElement.removeChild(child) @@ -429,6 +429,7 @@ function setupEditor (editorEl) { const editorBtn = id => editorEl.querySelector(`*[data-button="${id}"]`) + // XXX: Por qué está duplicada de types.js esta función? const tagNameSetFn = tagName => el => { const newEl = document.createElement(tagName) moveChildren(el, newEl, null)