From 75306a4fa02a77ba83cd27662eacaae32a367f59 Mon Sep 17 00:00:00 2001 From: Alan Date: Thu, 12 May 2022 11:21:34 +0800 Subject: [PATCH] fix clear both on ctrl-enter --- docs/src/Roo_htmleditor_KeyEnter.js.html | 2 +- roojs-all.js | 2 +- roojs-bootstrap-debug.js | 2 +- roojs-bootstrap.js | 2 +- roojs-debug.js | 2 +- roojs-ui-debug.js | 2 +- roojs-ui.js | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/docs/src/Roo_htmleditor_KeyEnter.js.html b/docs/src/Roo_htmleditor_KeyEnter.js.html index 3a8909ebe5..a450ae2251 100644 --- a/docs/src/Roo_htmleditor_KeyEnter.js.html +++ b/docs/src/Roo_htmleditor_KeyEnter.js.html @@ -51,7 +51,7 @@ // only do this if we have ctrl key.. var br = doc.createElement('br'); br.className = 'clear'; - br.setAttribute('style', 'clear:all'); + br.setAttribute('style', 'clear: both'); sel.insertNode(br, 'after'); } diff --git a/roojs-all.js b/roojs-all.js index 529cd09a5f..dcbbe98ad0 100644 --- a/roojs-all.js +++ b/roojs-all.js @@ -1980,7 +1980,7 @@ while(i--){C[A[i]]={};}return C;}};Roo.htmleditor.TidyEntities.init(); // Roo/htmleditor/KeyEnter.js Roo.htmleditor.KeyEnter=function(A){Roo.apply(this,A);Roo.get(this.core.doc.body).on('keypress',this.keypress,this);};Roo.htmleditor.KeyEnter.prototype={core:false,keypress:function(e){if(e.charCode!=13&&e.charCode!=10){Roo.log([e.charCode,e]);return true; }e.preventDefault();var A=this.core.doc;var B=this.core.getSelection();var C=B.getRangeAt(0);var n=C.commonAncestorContainer;var pc=C.closest(['ol','ul']);var D=C.closest('li');if(!pc||e.ctrlKey){if(!e.ctrlKey){B.insertNode('br','after');}else{var br=A.createElement('br'); -br.className='clear';br.setAttribute('style','clear:all');B.insertNode(br,'after');}this.core.undoManager.addEvent();this.core.fireEditorEvent(e);return false;}if(D.innerText.trim()==''&&D.previousSibling&&D.previousSibling.nodeName=='LI'&&D.previousSibling.innerText.trim()==''){D.parentNode.removeChild(D.previousSibling); +br.className='clear';br.setAttribute('style','clear: both');B.insertNode(br,'after');}this.core.undoManager.addEvent();this.core.fireEditorEvent(e);return false;}if(D.innerText.trim()==''&&D.previousSibling&&D.previousSibling.nodeName=='LI'&&D.previousSibling.innerText.trim()==''){D.parentNode.removeChild(D.previousSibling); B.cursorAfter(pc);this.core.undoManager.addEvent();this.core.fireEditorEvent(e);return false;}var li=A.createElement('LI');li.innerHTML=' ';if(!D||!D.firstSibling){pc.appendChild(li);}else{D.parentNode.insertBefore(li,D.firstSibling);}B.cursorText(li.firstChild); this.core.undoManager.addEvent();this.core.fireEditorEvent(e);return false;}}; // Roo/htmleditor/Block.js diff --git a/roojs-bootstrap-debug.js b/roojs-bootstrap-debug.js index 24d9856cc2..60810fe4f2 100644 --- a/roojs-bootstrap-debug.js +++ b/roojs-bootstrap-debug.js @@ -26937,7 +26937,7 @@ Roo.htmleditor.KeyEnter.prototype = { // only do this if we have ctrl key.. var br = doc.createElement('br'); br.className = 'clear'; - br.setAttribute('style', 'clear:all'); + br.setAttribute('style', 'clear: both'); sel.insertNode(br, 'after'); } diff --git a/roojs-bootstrap.js b/roojs-bootstrap.js index b10f834caa..43d5254423 100644 --- a/roojs-bootstrap.js +++ b/roojs-bootstrap.js @@ -1168,7 +1168,7 @@ for(var i=0;i