提交 5040b70f 编写于 作者: C campaign

by zhanyi

上级 17ea3f89
......@@ -66,6 +66,7 @@
me.setOpt({
isShow: true,
initialContent: '',
initialStyle:'p{line-height:1em}',
autoClearinitialContent: false,
iframeCssUrl: me.options.UEDITOR_HOME_URL + 'themes/iframe.css',
textarea: 'editorValue',
......
......@@ -1138,15 +1138,12 @@
if(ignoreTxt){
if(node.nodeType == 3){
var tmpNode = node;
while(tmpNode = tmpNode.previousSibling){
if(tmpNode.nodeType == 3){
firstIndex += tmpNode.nodeValue.replace(fillCharReg,'').length;
}else{
break;
}
var tmpNode = node.previousSibling;
while(tmpNode && tmpNode.nodeType == 3){
firstIndex += tmpNode.nodeValue.replace(fillCharReg,'').length;
tmpNode = tmpNode.previousSibling;
}
firstIndex += (isStart ? me.startOffset : me.endOffset) - (fillCharReg.test(node.nodeValue) ? 1 : 0 )
firstIndex += (isStart ? me.startOffset : me.endOffset)// - (fillCharReg.test(node.nodeValue) ? 1 : 0 )
}else{
node = node.childNodes[ isStart ? me.startOffset : me.endOffset];
if(node){
......
......@@ -13,7 +13,9 @@ UE.plugins['undo'] = function () {
maxUndoCount = me.options.maxUndoCount || 20,
maxInputCount = me.options.maxInputCount || 20,
fillchar = new RegExp(domUtils.fillChar + '|<\/hr>', 'gi');// ie会产生多余的</hr>
var noNeedFillCharTags = {
ol:1,ul:1,table:1,tbody:1,tr:1,body:1
};
var orgState = me.options.autoClearEmptyNode;
function compareAddr(indexA, indexB) {
if (indexA.length != indexB.length)
......@@ -89,7 +91,7 @@ UE.plugins['undo'] = function () {
try{
var rng = new dom.Range(me.document).moveToAddress(scene.address);
rng.select(domUtils.isBody(rng.startContainer));
rng.select(noNeedFillCharTags[rng.startContainer.nodeName.toLowerCase()]);
}catch(e){}
this.update();
......@@ -112,7 +114,7 @@ UE.plugins['undo'] = function () {
browser.ie && (cont = cont.replace(/>&nbsp;</g, '><').replace(/\s*</g, '<').replace(/>\s*/g, '>'));
me.fireEvent('aftergetscene');
try{
!notSetCursor && rng.moveToAddress(restoreAddress).select(true);
!notSetCursor && rng.moveToAddress(restoreAddress).select(noNeedFillCharTags[rng.startContainer.nodeName.toLowerCase()]);
}catch(e){}
return {
address:rngAddress,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册