1
0
mirror of https://shylinux.com/x/volcanos synced 2025-04-26 01:04:06 +08:00
This commit is contained in:
shaoying 2020-09-24 19:06:56 +08:00
parent 2ea5a22363
commit ca8b0a8ab5
2 changed files with 28 additions and 1 deletions

View File

@ -627,6 +627,7 @@ Volcanos("onkeypop", {help: "键盘交互", list: [], _init: function(can) {
})
})
document.body.onkeydown = function(event) { if (event.target != document.body) { return }
if (can.onkeypop.action && can.onkeypop.action.onimport) {
can.onkeypop.action.onimport.keydown(event, can.onkeypop.action, event.key)
@ -634,6 +635,32 @@ Volcanos("onkeypop", {help: "键盘交互", list: [], _init: function(can) {
}
switch (event.key) {
case " ":
break
case "g":
can.page.Select(can, document.body, "fieldset.Action>div.output", function(item) {
item.scrollBy(0, -10000)
})
break
case "j":
can.page.Select(can, document.body, "fieldset.Action>div.output", function(item) {
item.scrollBy(0, 30)
})
break
case "f":
can.page.Select(can, document.body, "fieldset.Action>div.output", function(item) {
item.scrollBy(0, 300)
})
break
case "e":
can.page.Select(can, document.body, "fieldset.Action>div.output", function(item) {
item.scrollBy(0, -30)
})
break
case "k":
can.page.Select(can, document.body, "fieldset.Action>div.output", function(item) {
item.scrollBy(0, -30)
})
break
default:
return
}

View File

@ -287,7 +287,7 @@ Volcanos("onaction", {help: "控件交互", list: [],
})
can.page.Select(can, can.ui.tags, "tr", function(item, index) {
index == 1 && can.page.Select(can, item, "td", function(item, index) {
index == 0 && item.click()
index == 0 && item.innerText && item.click()
})
})
}, true)