mirror of
https://github.com/Insality/druid
synced 2025-09-27 18:12:21 +02:00
Add component instance with general methods. New component constructor
This commit is contained in:
@@ -2,11 +2,10 @@
|
||||
-- @module base.back_handler
|
||||
|
||||
local const = require("druid.const")
|
||||
local component = require("druid.system.component")
|
||||
|
||||
local M = component.new("back_handler", { const.ON_INPUT })
|
||||
|
||||
local M = {}
|
||||
M.interest = {
|
||||
const.ON_INPUT
|
||||
}
|
||||
|
||||
--- Component init function
|
||||
-- @function back_handler:init
|
||||
@@ -26,7 +25,7 @@ end
|
||||
-- @tparam table action on_input action
|
||||
function M.on_input(self, action_id, action)
|
||||
if action[const.RELEASED] then
|
||||
self.callback(self.context, self.params)
|
||||
self.callback(self:get_context(), self.params)
|
||||
end
|
||||
|
||||
return true
|
||||
|
Reference in New Issue
Block a user