1
0
mirror of https://shylinux.com/x/volcanos synced 2025-04-25 08:48:06 +08:00

mix github

This commit is contained in:
shaoying 2019-12-28 18:08:17 +08:00
commit ad06ef751c

View File

@ -76,7 +76,7 @@ Volcanos("ondetail", {help: "组件详情", list: ["选择", "编辑", "删除",
"删除": "delete", "删除": "delete",
"编辑": function(event, can, msg, index, key, cmd, td) { "编辑": function(event, can, msg, index, key, cmd, td) {
var text = td.innerHTML; var text = td.innerHTML;
can.page.Appends(can, td, [{type: "input", value: text, style: {width: td.clientWidth+"px"}, data: {onkeydown: function(event) { var input = can.page.Appends(can, td, [{type: "input", value: text, style: {width: td.clientWidth+"px"}, data: {onkeydown: function(event) {
if (event.key == " ") {return event.stopPropagation()} if (event.key == " ") {return event.stopPropagation()}
if (event.key != "Enter") {return} if (event.key != "Enter") {return}
if (key == "value" && msg.key) {key = msg.key[index]} if (key == "value" && msg.key) {key = msg.key[index]}
@ -84,7 +84,9 @@ Volcanos("ondetail", {help: "组件详情", list: ["选择", "编辑", "删除",
td.innerHTML = event.target.value; td.innerHTML = event.target.value;
can.user.toast("修改成功") can.user.toast("修改成功")
}, true) }, true)
}}}]).first.focus() }}}]).first;
input.focus();
input.setSelectionRange(0, input.value.length);
}, },
"复制": function(event, can, msg, index, key, cmd, target) { "复制": function(event, can, msg, index, key, cmd, target) {
can.user.toast(can.page.CopyText(can, target.innerHTML), "复制成功") can.user.toast(can.page.CopyText(can, target.innerHTML), "复制成功")