From dc242594a7b55a0c26069e6bc9eb69cf30a01093 Mon Sep 17 00:00:00 2001 From: harveyshao Date: Wed, 25 Aug 2021 19:41:21 +0800 Subject: [PATCH] opt some --- page/index.css | 2 +- panel/action.js | 7 +------ panel/cmd.js | 2 +- plugin/local/chat/div.css | 2 +- plugin/local/chat/div.js | 6 +++--- 5 files changed, 7 insertions(+), 12 deletions(-) diff --git a/page/index.css b/page/index.css index 6cf94555..b2227482 100644 --- a/page/index.css +++ b/page/index.css @@ -657,6 +657,6 @@ body.print fieldset.River>div.output div.item.select { border:solid 2px red; } -div.output fieldset.left>fieldset { +div.output fieldset.span>fieldset { float:left; overflow:auto; } diff --git a/panel/action.js b/panel/action.js index 0d725eca..d526ba95 100644 --- a/panel/action.js +++ b/panel/action.js @@ -30,9 +30,6 @@ Volcanos("onimport", {help: "导入数据", list: [], _init: function(can, msg) }}]) can.page.Modify(can, sub._output, {style: {"max-width": meta.width}}) - can.onengine.listen(can, "onaction_resize", function(width, height) { - can.page.Modify(can, sub._output, {style: {"max-width": meta.width = width-40}}) - }) sub._option.dataset = sub._option.dataset || {} meta.id && (sub._option.dataset.id = meta.id) @@ -102,9 +99,7 @@ Volcanos("onaction", {help: "交互操作", list: [], _init: function(can, msg, var ls = location.pathname.split("/") can.onimport._share(can, can.user.Search(can, can._SHARE) || ls[1]=="share" && ls[2]) }, - onresize: function(can, msg, width, height) { var args = {width: width, height: height} - can.Conf(args), can.onengine.signal(can, "onaction_resize", can.request({}, args)) - }, + onresize: function(can, msg, width, height) { can.Conf({width: width, height: height}) }, onsearch: function(can, msg, word) { if (word[0] == "*" || word[0] == can._PLUGIN) { can.onexport.plugin(can, msg, word) } }, diff --git a/panel/cmd.js b/panel/cmd.js index a4892426..f389dab8 100644 --- a/panel/cmd.js +++ b/panel/cmd.js @@ -15,7 +15,7 @@ Volcanos("onaction", {help: "交互操作", list: [], _init: function(can, msg, can.page.ClassList.add(can, can._target, "Action") }, _plugin: function(can, index, args, next) { - can.onappend.plugin(can, {type: "plugin", index: index, args: args, opts: can.user.Search(), width: window.innerWidth}, function(sub, meta) { + can.onappend.plugin(can, {type: "plugin", index: index, args: args, opts: can.user.Search(), width: window.innerWidth-40}, function(sub, meta) { sub.run = function(event, cmds, cb) { can.run(event, can.misc.Concat([ctx.ACTION, "run", index], cmds), cb) } diff --git a/plugin/local/chat/div.css b/plugin/local/chat/div.css index 86ef89f1..09f0de0f 100644 --- a/plugin/local/chat/div.css +++ b/plugin/local/chat/div.css @@ -1,7 +1,7 @@ fieldset.div div.output td { vertical-align:top; } -fieldset.div div.output fieldset.float>fieldset { +fieldset.div div.output fieldset.span>fieldset { float:left; overflow:auto; } fieldset.panel.cmd.main fieldset.div { diff --git a/plugin/local/chat/div.js b/plugin/local/chat/div.js index 3eebe609..0f438206 100644 --- a/plugin/local/chat/div.js +++ b/plugin/local/chat/div.js @@ -44,13 +44,13 @@ Volcanos("onimport", {help: "导入数据", list: [], _init: function(can, msg, } ui.item._add = function(data) { - if (node.meta.style == "left") { width = width * node.list.length } + if (node.meta.style == "span") { width = width * node.list.length } node.list.push(data) - if (node.meta.style == "left") { width = width / node.list.length } + if (node.meta.style == "span") { width = width / node.list.length } can.onmotion.clear(can, ui.list), can.onmotion.clear(can, ui.list._fieldset) can.core.List(node.list, function(node) { can.onimport._item(can, node, ui.list, width) }) } - if (node.meta.style == "left") { width = width / node.list.length } + if (node.meta.style == "span") { width = width / node.list.length } can.core.List(node.list, function(node) { can.onimport._item(can, node, ui.list, width) }) return ui.item },