提交 e84eebe4 编写于 作者: T taoqili

table.core

上级 15ca7960
......@@ -75,6 +75,7 @@ UE.plugins['table'] = function () {
"adaptbywindow":1,
"adaptbycustomer":1,
"insertparagraph":1,
"insertparagraphbeforetable":1,
"averagedistributecol":1,
"averagedistributerow":1
};
......@@ -513,7 +514,7 @@ UE.plugins['table'] = function () {
toggleDraggableState(me, false, "", null);
}
});
me.addListener("interlacetable",function(type,table){
me.addListener("interlacetable",function(type,table,classList){
if(!table) return;
var me = this,
rows = table.rows,
......@@ -522,7 +523,7 @@ UE.plugins['table'] = function () {
return list[index] ? list[index] : repeat ? list[index % list.length]: "";
};
for(var i = 0;i<len;i++){
rows[i].className = getClass(me.options.classList,i,true);
rows[i].className = getClass( classList|| me.options.classList,i,true);
}
});
me.addListener("uninterlacetable",function(type,table){
......@@ -536,6 +537,7 @@ UE.plugins['table'] = function () {
});
me.addListener("mousedown", mouseDownEvent);
me.addListener("mouseup", mouseUpEvent);
......
......@@ -820,16 +820,16 @@
if(!table) return -1;
var interlaced = table.getAttribute("interlaced");
if(cmd =="interlacetable"){
return (interlaced === "enabled") ? -1:0;
return /*(interlaced === "enabled") ? -1:*/0;
}else{
return (!interlaced||interlaced === "disabled") ? -1:0;
}
},
execCommand:function (cmd) {
execCommand:function (cmd,classList) {
var table = getTableItemsByRange(this).table;
if(cmd=="interlacetable"){
if( cmd == "interlacetable" ){
table.setAttribute("interlaced","enabled");
this.fireEvent("interlacetable",table);
this.fireEvent("interlacetable",table,classList);
}else{
table.setAttribute("interlaced","disabled");
this.fireEvent("uninterlacetable",table);
......
......@@ -281,9 +281,7 @@
setCellContent:function (cell, content) {
cell.innerHTML = content || (browser.ie ? domUtils.fillChar : "<br />");
},
cloneCell:function (cell, ignoreMerge) {
return UETable.cloneCell(cell,ignoreMerge);
},
cloneCell:UETable.cloneCell,
/**
* 获取跟当前单元格的右边竖线为左边的所有未合并单元格
*/
......@@ -813,6 +811,13 @@
tableRow.insertBefore(th, cell);
domUtils.remove(cell)
}
}else{
if (cell.tagName == 'TH') {
var td = cell.ownerDocument.createElement("td");
td.appendChild(cell.firstChild);
tableRow.insertBefore(td, cell);
domUtils.remove(cell)
}
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册