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

add modify.focus

This commit is contained in:
shaoying 2019-12-28 13:47:07 +08:00
parent 93ca4afb46
commit 4597718a87
3 changed files with 6 additions and 4 deletions

View File

@ -252,7 +252,7 @@ var can = Volcanos("chat", {
}),
}, Config.libs.concat(Config.list), function(can) {
can[Config.main] = can.Page(can, Config.main, Config, function(chat) {
chat.Login.Export(event||{}, can.user.Search(can, "layout")||"工作", "layout")
chat.Login.Export(event||{}, can.user.Search(can, "layout")||Config.layout.def, "layout")
chat.Login.Import(event||{}, "", "login")
}, document.body)
})

View File

@ -30,7 +30,7 @@ var Config = {context: "/chat/",
{group: "index", name: "Action", pos: "bottom"},
{group: "index", name: "Footer", pos: "foot", state: ["ntxt", "ncmd"], title: '<a href="mailto:shylinux@163.com">shylinux@163.com</a>'},
], layout: {list: ["工作", "办公", "聊天"], size: {
], layout: {def: "办公", list: ["工作", "办公", "聊天"], size: {
"工作": {head: 30, foot: 30, left: 0, right: 100, bottom: -1, center: 0, top: 0},
"办公": {head: 30, foot: 30, left: 100, right: 100, bottom: -1, center: 0, top: 0},
"聊天": {head: 30, foot: 30, left: 100, right: 100, bottom: 300, center: 40, top: -2},

View File

@ -76,7 +76,7 @@ Volcanos("ondetail", {help: "组件详情", list: ["选择", "编辑", "删除",
"删除": "delete",
"编辑": function(event, can, msg, index, key, cmd, td) {
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 != "Enter") {return}
if (key == "value" && msg.key) {key = msg.key[index]}
@ -84,7 +84,9 @@ Volcanos("ondetail", {help: "组件详情", list: ["选择", "编辑", "删除",
td.innerHTML = event.target.value;
can.user.toast("修改成功")
}, true)
}}}]).first.focus()
}}}]).first;
input.focus();
input.setSelectionRange(0, input.value.length);
},
"复制": function(event, can, msg, index, key, cmd, target) {
can.user.toast(can.page.CopyText(can, target.innerHTML), "复制成功")