diff --git a/www/pad/comment.js b/www/pad/comment.js index 7f8da3021..040de6573 100644 --- a/www/pad/comment.js +++ b/www/pad/comment.js @@ -2,22 +2,27 @@ var CKEDITOR = window.CKEDITOR; function isUnstylable (el) { + if (el.hasClass('cke_widget_mediatag')) { + return false; + } var b = el.getAttribute( 'contentEditable' ) === 'false' || el.getAttribute( 'data-nostyle' ); return b; } - var color1 = 'rgba(252, 165, 3, 0.8);'; - var color2 = 'rgba(252, 231, 3, 0.8);'; + var color1 = 'rgba(252, 165, 3, 0.8)'; + var color2 = 'rgba(252, 231, 3, 0.8)'; CKEDITOR.plugins.add('comments', { //requires: 'dialog,widget', //icons: 'image', //hidpi: true, onLoad: function () { - CKEDITOR.addCss('comment { background-color: '+color1+' }' + - '@keyframes color { 0% { background-color: '+color2+' } 50% { background-color: '+color1+' } 100% { background-color: '+color2+' } }' + - 'comment.active { animation-name: color; animation-duration: 1s; animation-iteration-count: 2; background-color: '+color2+' outline: none;}' + + CKEDITOR.addCss('comment { background-color: '+color1+'; }' + + '@keyframes color { 0% { background-color: '+color2+'; } 50% { background-color: '+color1+'; } 100% { background-color: '+color2+'; } }' + + 'comment.active { animation-name: color; animation-duration: 1s; animation-iteration-count: 2; background-color: '+color2+'; outline: none;}' + + 'comment media-tag { border: 2px solid '+color1+' !important; }' + + 'comment.active media-tag { border: 2px solid '+color2+' !important; }' + 'comment * { background-color: transparent !important; }'); }, init: function (editor) { diff --git a/www/pad/comments.js b/www/pad/comments.js index 6a75d1575..356fc8685 100644 --- a/www/pad/comments.js +++ b/www/pad/comments.js @@ -357,7 +357,7 @@ define([ var uids = Env.$inner.find('comment').map(function (i, el) { var id = el.getAttribute('data-uid'); // Empty comment: remove from dom - if (!el.innerText && el.parentElement) { + if (!el.innerHTML && el.parentElement) { el.parentElement.removeChild(el); changed = true; return;