rename instance to self, update example

This commit is contained in:
Insality
2019-04-07 15:19:39 +03:00
parent 636df146c9
commit 08eae3800c
7 changed files with 249 additions and 247 deletions

View File

@@ -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