mirror of
https://github.com/Insality/druid.git
synced 2025-09-29 11:02:18 +02:00
rename instance to self, update example
This commit is contained in:
@@ -6,19 +6,19 @@ M.interest = {
|
||||
}
|
||||
|
||||
|
||||
function M.init(instance, callback, params)
|
||||
instance.event = data.A_ANDR_BACK
|
||||
instance.callback = callback
|
||||
instance.params = params
|
||||
function M.init(self, callback, params)
|
||||
self.event = data.A_ANDR_BACK
|
||||
self.callback = callback
|
||||
self.params = params
|
||||
end
|
||||
|
||||
|
||||
--- input handler
|
||||
-- @param action_id - input action id
|
||||
-- @param action - input action
|
||||
function M.on_input(instance, action_id, action)
|
||||
function M.on_input(self, action_id, action)
|
||||
if action[data.RELEASED] then
|
||||
instance.callback(instance.parent.parent, instance.params)
|
||||
self.callback(self.parent.parent, self.params)
|
||||
end
|
||||
return true
|
||||
end
|
||||
|
Reference in New Issue
Block a user