提交 0a2534a8 编写于 作者: T taoqili

预览时去除表格框选样式

上级 2d01d819
......@@ -1963,17 +1963,22 @@ UE.plugins['table'] = function () {
queryCommandState:function () {
return getTableItemsByRange(this).table ? 0 : -1
},
execCommand:function (cmd, color) {
execCommand:function (cmd, opt) {
var rng = this.selection.getRange(),
table = domUtils.findParentByTagName(rng.startContainer, 'table');
if (table) {
var arr = domUtils.getElementsByTagName(table, "td").concat(
domUtils.getElementsByTagName(table, "th"),
domUtils.getElementsByTagName(table, "caption")
);
utils.each(arr, function (node) {
node.style.borderColor = color;
domUtils.setAttributes(table,{
border:opt.width,
borderColor:opt.color||"#ddd"
});
if(opt["style"]) table.style.borderStyle = opt["style"];
}
}
};
......
......@@ -39,6 +39,15 @@
<span><var id="lang_color"></var></span>
<input type="text" class="tone" id="J_tone" readonly='readonly' />
</li>
<li>
<span>宽度</span>
<input type="text" class="tone" id="J_width" />
</li>
<li>
<span>样式</span>
<input type="text" class="tone" id="J_style" />
</li>
</ul>
<div class="clear"></div>
</div>
......@@ -50,6 +59,7 @@
</div>
</div>
</div>
<table ></table>
</div>
<script type="text/javascript" src="edittable.js"></script>
</body>
......
......@@ -179,7 +179,7 @@
} else {
editor.queryCommandState("deletecaption") != -1 && editor.execCommand("deletecaption");
}
editor.execCommand("edittable", tone.value);
editor.execCommand("edittable", {color:tone.value,width:$G("J_width").value,"style":$G("J_style").value});
autoSizeContent.checked ? adaptByTextTable() : "";
autoSizePage.checked ? editor.execCommand("adaptbywindow") : "";
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册