From b38441ed1f1f90d84250bb4d0247698eff94659f Mon Sep 17 00:00:00 2001 From: harveyshao Date: Sat, 8 May 2021 21:48:33 +0800 Subject: [PATCH] opt some --- panel/Header.js | 2 +- plugin/story/spide.css | 3 ++- plugin/story/spide.js | 10 +++++++--- proto.js | 2 +- 4 files changed, 11 insertions(+), 6 deletions(-) diff --git a/panel/Header.js b/panel/Header.js index 481d40dd..6e102339 100644 --- a/panel/Header.js +++ b/panel/Header.js @@ -276,7 +276,7 @@ Volcanos("onaction", {help: "交互数据", list: [], _init: function(can, msg, logout: function(event, can) { can.user.logout(can) }, River: function(can) { can.run({}, [can._SEARCH, "River.onmotion.toggle"]) }, - Footer: function(can) { can.run({}, [can._SEARCH, "River.onmotion.toggle"]) }, + Footer: function(can) { can.run({}, [can._SEARCH, "Footer.onmotion.toggle"]) }, }) Volcanos("onexport", {help: "导出数据", list: [], height: function(can) { return can._target.offsetHeight }, diff --git a/plugin/story/spide.css b/plugin/story/spide.css index 1d0eda47..e3fb7a54 100644 --- a/plugin/story/spide.css +++ b/plugin/story/spide.css @@ -1,7 +1,8 @@ fieldset.float.inner.editor { /* background-color:#332f1ecf; */ + z-index:10; } fieldset.float.inner.editor div.output { background-color:#332f1ecf; - max-width:800px; + /* max-width:800px; */ } diff --git a/plugin/story/spide.js b/plugin/story/spide.js index 558ead75..e078c66d 100644 --- a/plugin/story/spide.js +++ b/plugin/story/spide.js @@ -136,15 +136,19 @@ Volcanos("ondetail", {help: "用户交互", list: [], return } - can.ondetail._show(event, can, [can.dir_root, tree.file, tree.line]) + can.ondetail.plugin(event, can, [can.dir_root, tree.file, tree.line]) }, - _show: function(event, can, args) { + plugin: function(event, can, args) { can.onappend.plugin(can, {type: "float", index: "web.code.inner", args: args, _action: ["关闭"]}, function(sub) { - can.page.Modify(can, sub._target, {style: {position: "fixed"}}) sub.run = function(event, cmds, cb) { can.run(event, ["action", "inner"].concat(cmds), cb, true) can.onlayout.figure(event, sub, sub._target) + + can.search(["Action.onexport.size"], function(msg, left, top, width, height) { left = left||0 + can.page.Modify(can, sub._target, {style: {position: "fixed", left: left}}) + can.page.Modify(can, sub._output, {style: {"max-width": width}}) + }) } }) }, diff --git a/proto.js b/proto.js index 9d6613c3..c124076c 100644 --- a/proto.js +++ b/proto.js @@ -82,7 +82,7 @@ var Volcanos = shy("火山架", {args: {}, data: {}, pack: {}, libs: [], cache: get: function(target, field) { return can.run({}, ["search", target+".onexport."+field]) }, - search: function(cmds, cb) { can.run({}, ["search"].concat(cmds), cb) }, + search: function(cmds, cb) { can.run({}, ["search"].concat(cmds), cb, true) }, Conf: function(key, value) { return can.core.Value(can._conf, key, value) }, _conf: {}, }; can = can || {}; for (var k in proto) { can.hasOwnProperty(k) || (can[k] = proto[k]) }