1
0
mirror of https://shylinux.com/x/volcanos synced 2025-04-26 01:04:06 +08:00
This commit is contained in:
harveyshao 2022-03-08 23:53:09 +08:00
parent 80c3b436c4
commit 0bef91933a
6 changed files with 22 additions and 6 deletions

View File

@ -456,6 +456,7 @@ Volcanos("onappend", {help: "渲染引擎", list: [], _init: function(can, meta,
}, ui.output), can.onappend.board(can, msg.Result(), ui.output) }, ui.output), can.onappend.board(can, msg.Result(), ui.output)
return ui return ui
}, },
}) })
Volcanos("onlayout", {help: "页面布局", list: [], _init: function(can, target) { target = target||document.body Volcanos("onlayout", {help: "页面布局", list: [], _init: function(can, target) { target = target||document.body
if (can.page.Select(can, target, html.FIELDSET_MAIN+".page").length > 0) { if (can.page.Select(can, target, html.FIELDSET_MAIN+".page").length > 0) {

View File

@ -414,5 +414,13 @@ Volcanos("page", {help: "用户界面", ClassList: {
while (item) { res += item.offsetLeft||0, item = item.parentNode } while (item) { res += item.offsetLeft||0, item = item.parentNode }
return res return res
}, },
AppendVue: function(can, meta, list, target) {
can.require(["https://cdn.jsdelivr.net/npm/vue@2/dist/vue.js"], function() {
can.require(["https://unpkg.com/element-ui/lib/index.js", "https://unpkg.com/element-ui/lib/theme-chalk/index.css"], function() {
new Vue(can.base.Copy({el: can.page.Append(can, target||can._output, [{type: "div", inner: list}]).first}, meta))
})
})
},
}) })

View File

@ -12,10 +12,10 @@ Volcanos("onfigure", {help: "控件详情", list: [], key: {
can.onfigure.key._init(can, msg, target), can.base.isFunc(cbs) && cbs(can, msg.Length() == 0) can.onfigure.key._init(can, msg, target), can.base.isFunc(cbs) && cbs(can, msg.Length() == 0)
}) })
}, },
onfocus: function(event, can, meta, cb, target) { if (target._figure) { return } target._figure = {}; cb(function(can, cbs) { // onfocus: function(event, can, meta, cb, target) { if (target._figure) { return } target._figure = {}; cb(function(can, cbs) {
target._figure = can.onlayout.figure(event, can, can._target, false, {top: can.page.offsetTop(target)+target.offsetHeight, left: can.page.offsetLeft(target)}) // target._figure = can.onlayout.figure(event, can, can._target, false, {top: can.page.offsetTop(target)+target.offsetHeight, left: can.page.offsetLeft(target)})
can.onfigure.key._show(event, can, meta.name, cbs, target), can.onmotion.focus(can, target) // can.onfigure.key._show(event, can, meta.name, cbs, target), can.onmotion.focus(can, target)
}) }, // }) },
onblur: function(event, can, meta, cb, target) { onblur: function(event, can, meta, cb, target) {
can.onmotion.delay(can, function() { delete(target._figure), target._can && target._can.close() }) can.onmotion.delay(can, function() { delete(target._figure), target._can && target._can.close() })
}, },

View File

@ -25,6 +25,9 @@ fieldset.inner>div.action div.tabs.select {
fieldset.inner>div.output { fieldset.inner>div.output {
color:white; color:white;
} }
fieldset.inner>div.output div.code {
height:-webkit-fill-available;
}
fieldset.inner>div.output>table.layout div.toggle.project { fieldset.inner>div.output>table.layout div.toggle.project {
min-width:15px; font-size:24px; min-width:15px; font-size:24px;
} }

View File

@ -189,7 +189,11 @@ Volcanos("onimport", {help: "导入数据", _init: function(can, msg, cb, target
if (!height) { return } if (!height) { return }
can.page.style(can, can.ui.content, can.user.mod.isCmd? html.HEIGHT: html.MAX_HEIGHT, height) can.page.style(can, can.ui.content, can.user.mod.isCmd? html.HEIGHT: html.MAX_HEIGHT, height)
if (can.ui.project.style.display != html.NONE) { if (can.ui.project.style.display != html.NONE) {
can.page.styleHeight(can, can.ui.project, can.ui.content.offsetHeight) if (!can.user.mod.isCmd && can.ui.display.style.display != html.NONE) {
can.page.styleHeight(can, can.ui.project, can.ui.content.offsetHeight+can.ui.display.offsetHeight+html.ACTION_HEIGHT)
} else {
can.page.styleHeight(can, can.ui.project, can.ui.content.offsetHeight)
}
} }
if (can.user.mod.isCmd) { if (can.user.mod.isCmd) {
can.page.styleHeight(can, can.ui.content, (can.ui.project.offsetHeight||height) can.page.styleHeight(can, can.ui.content, (can.ui.project.offsetHeight||height)

View File

@ -80,7 +80,7 @@ Volcanos("onaction", {help: "用户操作", list: ["编辑", [ice.VIEW, "横向"
can.svg.Val(html.HEIGHT, can.height+can.margin) can.svg.Val(html.HEIGHT, can.height+can.margin)
}, },
"生成图片": function(event, can) { "生成图片": function(event, can) {
can.user.toPNG(can, "hi.png", can.svg.outerHTML, can.svg.Val(html.HEIGHT), can.svg.Val(html.WIDTH)) can.onmotion.toimage(event, can, can._legend.innerText, can._output)
}, },
_draw: function(can, tree, x, y, style) { _draw: function(can, tree, x, y, style) {
var color = can.onimport._color(can, tree) var color = can.onimport._color(can, tree)