mirror of
https://github.com/Insality/druid.git
synced 2025-09-27 18:12:19 +02:00
Update component docs
This commit is contained in:
@@ -1,6 +1,14 @@
|
||||
--- Component to handle back key (android, backspace)
|
||||
-- @module druid.back_handler
|
||||
|
||||
--- Component events
|
||||
-- @table Events
|
||||
-- @tfield druid_event on_back On back handler callback
|
||||
|
||||
--- Component fields
|
||||
-- @table Fields
|
||||
-- @tfield any params Params to click callbacks
|
||||
|
||||
local Event = require("druid.event")
|
||||
local const = require("druid.const")
|
||||
local component = require("druid.component")
|
||||
@@ -10,11 +18,9 @@ local M = component.create("back_handler", { const.ON_INPUT })
|
||||
|
||||
--- Component init function
|
||||
-- @function back_handler:init
|
||||
-- @tparam table self Component instance
|
||||
-- @tparam callback callback On back button
|
||||
-- @tparam[opt] params Callback argument
|
||||
function M.init(self, callback, params)
|
||||
self.callback = callback
|
||||
self.params = params
|
||||
|
||||
self.on_back = Event(callback)
|
||||
|
Reference in New Issue
Block a user