From 4597718a879303509b973ffd942a6b75f3f72057 Mon Sep 17 00:00:00 2001 From: shaoying Date: Sat, 28 Dec 2019 13:47:07 +0800 Subject: [PATCH] add modify.focus --- frame.js | 2 +- order.js | 2 +- plugin/table.js | 6 ++++-- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/frame.js b/frame.js index 96bac7d5..6398c3f1 100644 --- a/frame.js +++ b/frame.js @@ -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) }) diff --git a/order.js b/order.js index e7bd5bc7..a9287ebb 100644 --- a/order.js +++ b/order.js @@ -30,7 +30,7 @@ var Config = {context: "/chat/", {group: "index", name: "Action", pos: "bottom"}, {group: "index", name: "Footer", pos: "foot", state: ["ntxt", "ncmd"], title: 'shylinux@163.com'}, - ], 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}, diff --git a/plugin/table.js b/plugin/table.js index cf34b7c3..5a2038b2 100644 --- a/plugin/table.js +++ b/plugin/table.js @@ -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), "复制成功")