提交 ea06fbd3 编写于 作者: H hancong03

表格交替变色

Signed-off-by: Nhancong03 <121371790@qq.com>
上级 782c8aa3
......@@ -65,7 +65,7 @@ UE.plugins['table'] = function () {
'tdvalign':'top',
'cursorpath':me.options.UEDITOR_HOME_URL + "themes/default/images/cursor_",
'tableDragable':false,
'classList':["back1","back2"]
'classList':["ue-table-interlace-color-single","ue-table-interlace-color-double"]
});
me.getUETable = getUETable;
var commands = {
......@@ -106,6 +106,7 @@ UE.plugins['table'] = function () {
'td,th{padding: 5px 10px;border: 1px solid #DDD;}' +
'caption{border:1px dashed #DDD;border-bottom:0;padding:3px;text-align:center;}' +
'th{border-top:2px solid #BBB;background:#F7F7F7;}' +
'.ue-table-interlace-color-single{ background-color: #fcfcfc; } .ue-table-interlace-color-double{ background-color: #f7faff; }' +
'td p{margin:0;padding:0;}', me.document);
var tableCopyList, isFullCol, isFullRow;
......@@ -536,6 +537,9 @@ UE.plugins['table'] = function () {
toggleDraggableState(me, false, "", null);
}
});
/**
* 表格隔行变色
*/
me.addListener("interlacetable",function(type,table,classList){
if(!table) return;
var me = this,
......
......@@ -850,8 +850,9 @@
if(!table) return -1;
var interlaced = table.getAttribute("interlaced");
if(cmd =="interlacetable"){
//TODO 待定
//是否需要待定,如果设置,则命令只能单次执行成功,但反射具备toggle效果;否则可以覆盖前次命令,但反射将不存在toggle效果
return /*(interlaced === "enabled") ? -1:*/0;
return (interlaced === "enabled") ? -1:0;
}else{
return (!interlaced||interlaced === "disabled") ? -1:0;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册