roojs-ui.js
authorAlan <alan@roojs.com>
Fri, 24 Dec 2021 06:47:59 +0000 (14:47 +0800)
committerAlan <alan@roojs.com>
Fri, 24 Dec 2021 06:47:59 +0000 (14:47 +0800)
roojs-ui-debug.js
roojs-bootstrap.js
roojs-bootstrap-debug.js
roojs-all.js
roojs-debug.js
Roo/htmleditor/KeyEnter.js

Roo/htmleditor/KeyEnter.js
roojs-all.js
roojs-bootstrap-debug.js
roojs-bootstrap.js
roojs-debug.js
roojs-ui-debug.js
roojs-ui.js

index 82ff4a4..bf61792 100644 (file)
@@ -81,7 +81,7 @@ Roo.htmleditor.KeyEnter.prototype = {
         
         range.insertNode(docFragment);
         range = range.cloneRange();
-        range.collapse(false);
+        range.collapse(true);
         var sel = this.core.win.getSelection();
         sel.removeAllRanges();
         sel.addRange(range);
index 1b14a60..eeef7ba 100644 (file)
@@ -1937,7 +1937,8 @@ i++){if(!A.attributes.item(i).value.length){continue;}B.push(A.attributes.item(i
 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){return true;}e.preventDefault();var A=this.core.doc;
 var B=A.createDocumentFragment();var C=A.createTextNode('\n');B.appendChild(C);var D=this.core.win.getSelection().getRangeAt(0);var n=D.commonAncestorContainer;while(n&&n.nodeType!=1){n=n.parentNode;}var li=false;if(n&&n.tagName=='UL'){li=A.createElement('LI');
 n.appendChild(li);}if(n&&n.tagName=='LI'){li=A.createElement('LI');if(n.nextSibling){n.parentNode.insertBefore(li,n.firstSibling);}else{n.parentNode.appendChild(li);}}if(li){D=A.createRange();D.setStartAfter(li);D.collapse(true);var E=this.core.win.getSelection();
-E.removeAllRanges();E.addRange(D);return false;}C=A.createElement('br');B.appendChild(C);D.deleteContents();D.insertNode(B);D=D.cloneRange();D.collapse(false);var E=this.core.win.getSelection();E.removeAllRanges();E.addRange(D);return false;}};
+E.removeAllRanges();E.addRange(D);return false;}C=A.createElement('br');B.appendChild(C);D.deleteContents();D.insertNode(B);D=D.cloneRange();D.collapse(true);var E=this.core.win.getSelection();E.removeAllRanges();E.addRange(D);E.collapseToEnd();return false;
+}};
 // Roo/htmleditor/Block.js
 Roo.htmleditor.Block=function(A){};Roo.htmleditor.Block.factory=function(A){var id=Roo.get(A).id;if(typeof(Roo.htmleditor.Block.cache[id])!='undefined'){Roo.htmleditor.Block.cache[id].readElement();return Roo.htmleditor.Block.cache[id];}var B=Roo.htmleditor['Block'+A.getAttribute('data-block')];
 if(typeof(B)=='undefined'){Roo.log("OOps missing block : "+'Block'+A.getAttribute('data-block'));return false;}Roo.htmleditor.Block.cache[id]=new B({node:A});return Roo.htmleditor.Block.cache[id];};Roo.htmleditor.Block.cache={};Roo.htmleditor.Block.prototype={node:false,friendly_name:'Image with caption',context:false,updateElement:function(A){Roo.DomHelper.update(A===undefined?this.node:A,this.toObject());
index ee33bed..24d08a1 100644 (file)
@@ -26787,11 +26787,11 @@ Roo.htmleditor.KeyEnter.prototype = {
         
         range.insertNode(docFragment);
         range = range.cloneRange();
-        range.collapse(false);
+        range.collapse(true);
         var sel = this.core.win.getSelection();
         sel.removeAllRanges();
         sel.addRange(range);
-        
+        sel.collapseToEnd();
     
         return false;
          
index 9085e1f..c1e7531 100644 (file)
@@ -1161,7 +1161,8 @@ return false;}if(!ps||ps.nodeType!=1){return false;}if(!ps||ps.tagName!='BR'){re
 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){return true;}e.preventDefault();var A=this.core.doc;
 var B=A.createDocumentFragment();var C=A.createTextNode('\n');B.appendChild(C);var D=this.core.win.getSelection().getRangeAt(0);var n=D.commonAncestorContainer;while(n&&n.nodeType!=1){n=n.parentNode;}var li=false;if(n&&n.tagName=='UL'){li=A.createElement('LI');
 n.appendChild(li);}if(n&&n.tagName=='LI'){li=A.createElement('LI');if(n.nextSibling){n.parentNode.insertBefore(li,n.firstSibling);}else{n.parentNode.appendChild(li);}}if(li){D=A.createRange();D.setStartAfter(li);D.collapse(true);var E=this.core.win.getSelection();
-E.removeAllRanges();E.addRange(D);return false;}C=A.createElement('br');B.appendChild(C);D.deleteContents();D.insertNode(B);D=D.cloneRange();D.collapse(false);var E=this.core.win.getSelection();E.removeAllRanges();E.addRange(D);return false;}};
+E.removeAllRanges();E.addRange(D);return false;}C=A.createElement('br');B.appendChild(C);D.deleteContents();D.insertNode(B);D=D.cloneRange();D.collapse(true);var E=this.core.win.getSelection();E.removeAllRanges();E.addRange(D);E.collapseToEnd();return false;
+}};
 // Roo/htmleditor/Block.js
 Roo.htmleditor.Block=function(A){};Roo.htmleditor.Block.factory=function(A){var id=Roo.get(A).id;if(typeof(Roo.htmleditor.Block.cache[id])!='undefined'){Roo.htmleditor.Block.cache[id].readElement();return Roo.htmleditor.Block.cache[id];}var B=Roo.htmleditor['Block'+A.getAttribute('data-block')];
 if(typeof(B)=='undefined'){Roo.log("OOps missing block : "+'Block'+A.getAttribute('data-block'));return false;}Roo.htmleditor.Block.cache[id]=new B({node:A});return Roo.htmleditor.Block.cache[id];};Roo.htmleditor.Block.cache={};Roo.htmleditor.Block.prototype={node:false,friendly_name:'Image with caption',context:false,updateElement:function(A){Roo.DomHelper.update(A===undefined?this.node:A,this.toObject());
index 379f23e..10518ad 100644 (file)
@@ -46314,11 +46314,11 @@ Roo.htmleditor.KeyEnter.prototype = {
         
         range.insertNode(docFragment);
         range = range.cloneRange();
-        range.collapse(false);
+        range.collapse(true);
         var sel = this.core.win.getSelection();
         sel.removeAllRanges();
         sel.addRange(range);
-        
+        sel.collapseToEnd();
     
         return false;
          
index 7fed8d1..483f559 100644 (file)
@@ -22026,11 +22026,11 @@ Roo.htmleditor.KeyEnter.prototype = {
         
         range.insertNode(docFragment);
         range = range.cloneRange();
-        range.collapse(false);
+        range.collapse(true);
         var sel = this.core.win.getSelection();
         sel.removeAllRanges();
         sel.addRange(range);
-        
+        sel.collapseToEnd();
     
         return false;
          
index 245f5f9..35acac5 100644 (file)
@@ -1001,7 +1001,8 @@ i++){if(!A.attributes.item(i).value.length){continue;}B.push(A.attributes.item(i
 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){return true;}e.preventDefault();var A=this.core.doc;
 var B=A.createDocumentFragment();var C=A.createTextNode('\n');B.appendChild(C);var D=this.core.win.getSelection().getRangeAt(0);var n=D.commonAncestorContainer;while(n&&n.nodeType!=1){n=n.parentNode;}var li=false;if(n&&n.tagName=='UL'){li=A.createElement('LI');
 n.appendChild(li);}if(n&&n.tagName=='LI'){li=A.createElement('LI');if(n.nextSibling){n.parentNode.insertBefore(li,n.firstSibling);}else{n.parentNode.appendChild(li);}}if(li){D=A.createRange();D.setStartAfter(li);D.collapse(true);var E=this.core.win.getSelection();
-E.removeAllRanges();E.addRange(D);return false;}C=A.createElement('br');B.appendChild(C);D.deleteContents();D.insertNode(B);D=D.cloneRange();D.collapse(false);var E=this.core.win.getSelection();E.removeAllRanges();E.addRange(D);return false;}};
+E.removeAllRanges();E.addRange(D);return false;}C=A.createElement('br');B.appendChild(C);D.deleteContents();D.insertNode(B);D=D.cloneRange();D.collapse(true);var E=this.core.win.getSelection();E.removeAllRanges();E.addRange(D);E.collapseToEnd();return false;
+}};
 // Roo/htmleditor/Block.js
 Roo.htmleditor.Block=function(A){};Roo.htmleditor.Block.factory=function(A){var id=Roo.get(A).id;if(typeof(Roo.htmleditor.Block.cache[id])!='undefined'){Roo.htmleditor.Block.cache[id].readElement();return Roo.htmleditor.Block.cache[id];}var B=Roo.htmleditor['Block'+A.getAttribute('data-block')];
 if(typeof(B)=='undefined'){Roo.log("OOps missing block : "+'Block'+A.getAttribute('data-block'));return false;}Roo.htmleditor.Block.cache[id]=new B({node:A});return Roo.htmleditor.Block.cache[id];};Roo.htmleditor.Block.cache={};Roo.htmleditor.Block.prototype={node:false,friendly_name:'Image with caption',context:false,updateElement:function(A){Roo.DomHelper.update(A===undefined?this.node:A,this.toObject());