forked from x/volcanos
opt some
This commit is contained in:
parent
72532d6239
commit
bdc17cf8d1
@ -177,7 +177,7 @@ Volcanos(chat.ONIMPORT, {help: "导入数据", _init: function(can, msg, cb, tar
|
|||||||
},
|
},
|
||||||
profile: function(can, msg) {
|
profile: function(can, msg) {
|
||||||
var width = can.profile_size[can.onexport.keys(can)]||(can.ConfWidth()-can.ui.project.offsetWidth)/2
|
var width = can.profile_size[can.onexport.keys(can)]||(can.ConfWidth()-can.ui.project.offsetWidth)/2
|
||||||
msg && can.onimport.process(can, msg, can.ui.profile_output, width-32)
|
msg && can.onimport.process(can, msg, can.ui.profile_output, width)
|
||||||
can.onmotion.toggle(can, can.ui.profile, true), can.onimport.layout(can)
|
can.onmotion.toggle(can, can.ui.profile, true), can.onimport.layout(can)
|
||||||
},
|
},
|
||||||
display: function(can, msg) {
|
display: function(can, msg) {
|
||||||
@ -198,16 +198,19 @@ Volcanos(chat.ONIMPORT, {help: "导入数据", _init: function(can, msg, cb, tar
|
|||||||
can.onappend.table(can, msg, null, target), can.onappend.board(can, msg, target)
|
can.onappend.table(can, msg, null, target), can.onappend.board(can, msg, target)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
toolkit: function(can, meta, cb) {
|
toolkit: function(can, meta, cb) { meta.msg = true
|
||||||
meta.opts = meta.opts||{repos: can.base.trimSuffix(can.base.trimPrefix(can.Option(nfs.PATH), "usr/"), ice.PS) }
|
meta.opts = meta.opts||{repos: can.base.trimSuffix(can.base.trimPrefix(can.Option(nfs.PATH), "usr/"), ice.PS) }
|
||||||
can.onimport.plugin(can, meta, can.ui.toolkit.output, function(sub) {
|
can.onimport.plugin(can, meta, can.ui.toolkit.output, function(sub) {
|
||||||
sub.ConfHeight(can.ConfHeight()-4*html.ACTION_HEIGHT), sub.ConfWidth(can.ConfWidth())
|
sub.ConfHeight(can.ConfHeight()-4*html.ACTION_HEIGHT), sub.ConfWidth(can.ConfWidth())
|
||||||
sub.page.style(sub, sub._output, html.MAX_HEIGHT, sub.ConfHeight())
|
sub.page.style(sub, sub._output, html.MAX_HEIGHT, sub.ConfHeight())
|
||||||
sub.page.style(sub, sub._output, html.MAX_WIDTH, sub.ConfWidth())
|
sub.page.style(sub, sub._output, html.MAX_WIDTH, sub.ConfWidth())
|
||||||
sub.select = function() { return sub._legend.click(), sub }
|
sub.select = function() {
|
||||||
|
return sub._legend.click(), sub
|
||||||
|
}
|
||||||
sub.onaction.close = function() { sub.select() }
|
sub.onaction.close = function() { sub.select() }
|
||||||
|
|
||||||
can._status.appendChild(sub._legend), sub._legend.onclick = function(event) {
|
can._status.appendChild(sub._legend), sub._legend.onclick = function(event) {
|
||||||
|
if (meta.msg == true) { meta.msg = false, sub.Update() }
|
||||||
if (can.page.Select(can, can._status, ice.PT+html.SELECT)[0] == event.target) {
|
if (can.page.Select(can, can._status, ice.PT+html.SELECT)[0] == event.target) {
|
||||||
can.page.ClassList.del(can, event.target, html.SELECT)
|
can.page.ClassList.del(can, event.target, html.SELECT)
|
||||||
can.page.ClassList.del(can, sub._target, html.SELECT)
|
can.page.ClassList.del(can, sub._target, html.SELECT)
|
||||||
@ -256,8 +259,8 @@ Volcanos(chat.ONIMPORT, {help: "导入数据", _init: function(can, msg, cb, tar
|
|||||||
can.core.Next(sess.plug, function(item, next) { can.onimport.toolkit(can, {index: item}, function(sub) { can.toolkit[item] = sub, next() }) }, function() {
|
can.core.Next(sess.plug, function(item, next) { can.onimport.toolkit(can, {index: item}, function(sub) { can.toolkit[item] = sub, next() }) }, function() {
|
||||||
can.core.Next(sess.exts, function(item, next) { can.onimport.exts(can, item, next) }, function() {
|
can.core.Next(sess.exts, function(item, next) { can.onimport.exts(can, item, next) }, function() {
|
||||||
var path = can.Option(nfs.PATH), file = can.Option(nfs.FILE), line = can.Option(nfs.LINE)
|
var path = can.Option(nfs.PATH), file = can.Option(nfs.FILE), line = can.Option(nfs.LINE)
|
||||||
can.core.Next(sess.tabs, function(item, next) { var ls = item.split(ice.DF); can.onimport.tabview(can, ls[0], ls[1], ls[2], next) },
|
can.base.getValid(sess.tabs)? can.core.Next(sess.tabs, function(item, next) { var ls = item.split(ice.DF); can.onimport.tabview(can, ls[0], ls[1], ls[2], next) },
|
||||||
function() { can.onimport.tabview(can, path, file, line, cb) })
|
function() { can.onimport.tabview(can, path, file, line, cb) }): can.base.isFunc(cb) && cb()
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
@ -93,13 +93,15 @@ Volcanos(chat.ONACTION, {help: "交互操作", list: [
|
|||||||
|
|
||||||
"刷新数据": function(event, can) { can.Update({}, can.Input([], true)) },
|
"刷新数据": function(event, can) { can.Update({}, can.Input([], true)) },
|
||||||
"切换全屏": function(event, can) { var sub = can._outputs[can._outputs.length-1]
|
"切换全屏": function(event, can) { var sub = can._outputs[can._outputs.length-1]
|
||||||
if (can.page.ClassList.neg(can, can._target, "full")) { sub._height_bak = sub.ConfHeight(), sub._width_bak = sub.ConfWidth()
|
if (can.page.ClassList.neg(can, can._target, "full")) {
|
||||||
can._mode = can.Mode(), can.Mode("full"), sub.Mode("full")
|
|
||||||
var height = can._root._height-(can._status.innerText? 2: 1)*html.ACTION_HEIGHT; can.user.isMobile && (height -= 2*html.ACTION_HEIGHT)
|
var height = can._root._height-(can._status.innerText? 2: 1)*html.ACTION_HEIGHT; can.user.isMobile && (height -= 2*html.ACTION_HEIGHT)
|
||||||
|
can._mode = can.Mode(), can._height_bak = sub.ConfHeight(), can._width_bak = sub.ConfWidth()
|
||||||
|
can.Mode("full"), can.ConfHeight(height), can.ConfWidth(can._root._width)
|
||||||
|
sub.Mode("full")
|
||||||
can.page.style(can, can._output, html.HEIGHT, sub.ConfHeight(height), html.MIN_WIDTH, sub.ConfWidth(can._root._width))
|
can.page.style(can, can._output, html.HEIGHT, sub.ConfHeight(height), html.MIN_WIDTH, sub.ConfWidth(can._root._width))
|
||||||
} else {
|
} else {
|
||||||
can.Mode(can._mode), sub.Mode(can._mode)
|
can.Mode(can._mode), can.ConfHeight(can._height_bak), can.ConfWidth(can._width_bak)
|
||||||
sub.ConfHeight(sub._height_bak), sub.ConfWidth(sub._width_bak)
|
sub.Mode(can._mode), sub.ConfHeight(can._height_bak), sub.ConfWidth(can._width_bak)
|
||||||
can.page.style(can, can._output, html.HEIGHT, "", html.MIN_WIDTH, "")
|
can.page.style(can, can._output, html.HEIGHT, "", html.MIN_WIDTH, "")
|
||||||
}
|
}
|
||||||
can.core.CallFunc([sub, chat.ONIMPORT, html.LAYOUT], {can: sub})
|
can.core.CallFunc([sub, chat.ONIMPORT, html.LAYOUT], {can: sub})
|
||||||
|
Loading…
x
Reference in New Issue
Block a user