mirror of
https://github.com/Insality/druid.git
synced 2025-09-28 02:22:18 +02:00
Update
This commit is contained in:
@@ -21,16 +21,6 @@ local component = require("druid.component")
|
||||
local M = component.create("swipe")
|
||||
|
||||
|
||||
---@param style druid.swipe.style
|
||||
function M:on_style_change(style)
|
||||
self.style = {
|
||||
SWIPE_TIME = style.SWIPE_TIME or 0.4,
|
||||
SWIPE_THRESHOLD = style.SWIPE_THRESHOLD or 50,
|
||||
SWIPE_TRIGGER_ON_MOVE = style.SWIPE_TRIGGER_ON_MOVE or false,
|
||||
}
|
||||
end
|
||||
|
||||
|
||||
---@param node_or_node_id node|string
|
||||
---@param on_swipe_callback function
|
||||
function M:init(node_or_node_id, on_swipe_callback)
|
||||
@@ -55,6 +45,16 @@ function M:on_late_init()
|
||||
end
|
||||
|
||||
|
||||
---@param style druid.swipe.style
|
||||
function M:on_style_change(style)
|
||||
self.style = {
|
||||
SWIPE_TIME = style.SWIPE_TIME or 0.4,
|
||||
SWIPE_THRESHOLD = style.SWIPE_THRESHOLD or 50,
|
||||
SWIPE_TRIGGER_ON_MOVE = style.SWIPE_TRIGGER_ON_MOVE or false,
|
||||
}
|
||||
end
|
||||
|
||||
|
||||
---@param action_id hash
|
||||
---@param action action
|
||||
function M:on_input(action_id, action)
|
||||
@@ -154,6 +154,4 @@ function M:_check_swipe(action)
|
||||
end
|
||||
|
||||
|
||||
|
||||
|
||||
return M
|
||||
|
Reference in New Issue
Block a user