From b6dd113562abe528bbff60f38c47a9fe31d04d65 Mon Sep 17 00:00:00 2001 From: shylinux Date: Tue, 18 May 2021 20:37:35 +0800 Subject: [PATCH] opt some --- page/index.js | 2 +- plugin/story/spide.js | 13 +++++++------ 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/page/index.js b/page/index.js index 1c199626..1b6d97ce 100644 --- a/page/index.js +++ b/page/index.js @@ -42,7 +42,7 @@ Volcanos({name: "chat", iceberg: "/chat/", volcano: "/frame.js", {name: "plan", help: "计划任务", index: "web.team.plan"}, {name: "think", help: "智库", index: "web.wiki.word", args: ["usr/learning/"]}, {name: "index", help: "索引", index: "web.wiki.word", args: ["usr/learning/index.shy"]}, - {name: "context", help: "编程", index: "web.wiki.word", args: ["usr/learning/自然/编程/index.shy"]}, + {name: "context", help: "编程", index: "web.wiki.word", args: ["src/main.shy"]}, ]}, "english": {name: "英汉 english", action: [ {name: "english", help: "英汉", index: "web.wiki.alpha.alpha", args: ["word", "hi"]}, diff --git a/plugin/story/spide.js b/plugin/story/spide.js index 24db9ad7..5a1cd9a6 100644 --- a/plugin/story/spide.js +++ b/plugin/story/spide.js @@ -144,19 +144,20 @@ Volcanos("ondetail", {help: "用户交互", list: [], sub.run = function(event, cmds, cb) { can.run(event, ["action", "inner"].concat(cmds), function(msg) { can.search(event, ["Action.onexport.size"], function(msg, left, top, width, height) { left = left||0 - var top = 120; if (can.user.isMobile) { + var top = 120, margin = 20; if (can.user.isMobile) { margin = 0 if (can.user.isLandscape) { - sub.Conf("height", window.innerHeight+240), top = 0 + sub.Conf("height", window.innerHeight+200) + top = 24 } else { - sub.Conf("height", window.innerHeight+160), top = 48 + sub.Conf("height", window.innerHeight+140) + top = 48 } } else { sub.Conf("height", height+120) } - // can.misc.Debug(sub.Conf("height"), cmds) - can.page.Modify(can, sub._target, {style: {position: "fixed", left: left+20, top: top}}) - can.page.Modify(can, sub._output, {style: {"max-width": width-40}}) + can.page.Modify(can, sub._target, {style: {position: "fixed", left: left+margin, top: top}}) + can.page.Modify(can, sub._output, {style: {"max-width": width-margin*2}}) can.base.isFunc(cb) && cb(msg) }) }, true)