提交 695314a7 编写于 作者: C campaign

by zhanyi

上级 466bc6c6
......@@ -326,6 +326,9 @@
return browser.ie ? nativeRange.text : nativeRange.toString();
}
return '';
},
clearRange : function(){
this.getNative()[browser.ie ? 'empty' : 'removeAllRanges']();
}
};
})();
\ No newline at end of file
......@@ -864,10 +864,24 @@ UE.plugins['table'] = function () {
function mouseUpEvent(type, evt) {
if (evt.button == 2)return;
var me = this;
//清除表格上原生跨选问题
var range = me.selection.getRange(),
start = domUtils.findParentByTagName(range.startContainer,'table',true),
end = domUtils.findParentByTagName(range.endContainer,'table',true);
if(start || end ){
if(start === end){
start = domUtils.findParentByTagName(range.startContainer,['td','th','caption'],true);
end = domUtils.findParentByTagName(range.endContainer,['td','th','caption'],true);
if(start !== end){
me.selection.clearRange()
}
}else{
me.selection.clearRange()
}
}
mousedown = false;
// if(browser.ie && !me.body.contentEditable){
// me.body.contentEditable = true;
// }
me.document.body.style.webkitUserSelect = '';
//拖拽状态下的mouseUP
if ((!browser.ie || (browser.ie && browser.version > 7)) && onDrag && dragTd) {
......@@ -890,7 +904,6 @@ UE.plugins['table'] = function () {
return;
}
//正常状态下的mouseup
var range = null;
if (!startTd) {
var target = domUtils.findParentByTagName(evt.target || evt.srcElement, "td", true);
if (!target) target = domUtils.findParentByTagName(evt.target || evt.srcElement, "th", true);
......@@ -927,6 +940,7 @@ UE.plugins['table'] = function () {
}
function mouseOverEvent(type, evt) {
var me = this;
currentTd = evt.target || evt.srcElement;
//需要判断两个TD是否位于同一个表格内
if (startTd &&
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册