1
0
mirror of https://shylinux.com/x/volcanos synced 2025-04-26 01:04:06 +08:00
This commit is contained in:
harveyshao 2021-08-09 22:41:14 +08:00
parent f5631ab80a
commit dedd22fc33
3 changed files with 20 additions and 11 deletions

View File

@ -372,7 +372,7 @@ Volcanos("onappend", {help: "渲染引擎", list: [], _init: function(can, meta,
if (item.name == key) { return {name: key, value: "@"+pkey+"="+value} }
})[0]||{name: key, value: "@key="+value}
can.onmotion.modify(can, target, function(event, value, old) { var msg = can.sup.request(event, can.Option())
can.onmotion.modifys(can, target, function(event, value, old) { var msg = can.sup.request(event, can.Option())
key == kit.MDB_VALUE? can.core.List(array, function(item, index) { msg.Option(item.key, item.value) }): msg.Option(line)
can.run(event, [ctx.ACTION, mdb.MODIFY, key == kit.MDB_VALUE? line.key||line.name: key, value], function(msg) { can.run() }, true)
}, item)
@ -675,11 +675,13 @@ Volcanos("onmotion", {help: "动态特效", list: [], _init: function(can, targe
}
})
},
modify: function(can, target, cb, item) { var back = target.innerHTML
modify: function(can, target, cb, item) { var back = target.innerHTML, text = target.innerText
if (back.length > 120 || back.indexOf("\n") > -1) {
return can.onmotion.modifys(can, target, cb)
}
var ui = can.page.Appends(can, target, [{type: html.INPUT, value: target.innerText, style: {width: target.offsetWidth > 400? 400: target.offsetWidth-20}, onkeydown: function(event) {
var ui = can.page.Appends(can, target, [{type: html.INPUT, value: target.innerText, style: {
width: target.offsetWidth > 400? 400: target.offsetWidth-20,
}, onkeydown: function(event) {
switch (event.key) {
case "Enter":
target.innerHTML = event.target.value
@ -695,11 +697,14 @@ Volcanos("onmotion", {help: "动态特效", list: [], _init: function(can, targe
}
}, _init: function(target) {
item && can.onappend.figure(can, item, item.value, function() {
}, target)
}, target), target.value = text
}}]); ui.first.focus(), ui.first.setSelectionRange(0, -1)
},
modifys: function(can, target, cb) { var back = target.innerHTML
var ui = can.page.Appends(can, target, [{type: html.TEXTAREA, value: back, style: {height: "80px", width: target.offsetWidth > 400? 400: target.offsetWidth-20}, onkeydown: function(event) {
var ui = can.page.Appends(can, target, [{type: html.TEXTAREA, value: target.innerText, style: {
width: target.offsetWidth > 400? 400: target.offsetWidth-20, height: target.offsetHeight < 60? 60: target.offsetHeight-20,
}, onkeydown: function(event) {
switch (event.key) {
case "Enter":
if (event.ctrlKey) {

View File

@ -39,6 +39,9 @@ Volcanos("onimport", {help: "导入数据", list: [], _init: function(can, msg)
sub._target.Meta = meta
},
_menu: function(can, msg) {
if (can.user.isMobile || can.user.Search(can, cli.POD)) {
return
}
can._menu && can.page.Remove(can, can._menu)
can._menu = can.search({}, ["Header.onimport.menu", can._ACTION,
["布局", "默认布局", "流动布局", "网格布局", "标签布局", "自由布局"],

View File

@ -24,14 +24,17 @@ Volcanos("onimport", {help: "导入数据", list: [], _init: function(can, msg,
can.core.CallFunc([can.ondetail, item], [event, can, item, can.Conf(chat.RIVER), can.Conf(chat.STORM)])
})
},
_carte: function(can, list, river, storm) {
(!can.user.isMobile && !can.user.Search(can, cli.POD)) && can.onaction.carte(event, can, list, function(event, button, module) {
module[button](event, can, button, river, storm)
})
},
_river: function(can, meta, cb) {
return {text: [meta.name, html.DIV, html.ITEM], onclick: function(event) {
can.onaction.storm(event, can, meta.hash)
}, onmouseenter: function(event) {
!can.user.isMobile && can.onaction.carte(event, can, can.ondetail.list, function(event, button, module) {
module[button](event, can, button, meta.hash)
})
can.onimport._carte(can, can.ondetail.list, meta.hash)
}, _init: function(target) { cb(target)
can.river_list[meta.hash] = target
}}
@ -42,9 +45,7 @@ Volcanos("onimport", {help: "导入数据", list: [], _init: function(can, msg,
can.user.title(can._main_title || meta.name)
}, onmouseenter: function(event) {
!can.user.isMobile && can.onaction.carte(event, can, can.ondetail.sublist, function(event, button, module) {
module[button](event, can, button, river, meta.hash)
})
can.onimport._carte(can, can.ondetail.sublist, river, meta.hash)
}, _init: function(target) {
can.storm_list[can.core.Keys(river, meta.hash)] = target
}}