Add grid:get_nodes function

This commit is contained in:
Insality 2020-09-21 01:12:31 +03:00
parent 94099e0a3e
commit 442ea090d3

View File

@ -27,7 +27,7 @@ local Event = require("druid.event")
local helper = require("druid.helper") local helper = require("druid.helper")
local component = require("druid.component") local component = require("druid.component")
local M = component.create("grid", { const.ON_LAYOUT_CHANGE }) local M = component.create("static_grid", { const.ON_LAYOUT_CHANGE })
--- Component init function --- Component init function
@ -222,7 +222,7 @@ function M.add(self, item, index)
end end
--- Remove the item from the grid. Node that gui node will be not deleted --- Remove the item from the grid. Note that gui node will be not deleted
-- @function static_grid:remove -- @function static_grid:remove
-- @tparam number index The grid node index to remove -- @tparam number index The grid node index to remove
-- @tparam bool is_shift_nodes If true, will shift nodes left after index -- @tparam bool is_shift_nodes If true, will shift nodes left after index
@ -317,4 +317,13 @@ function M.clear(self)
end end
--- Return the grid nodes table
-- @function static_grid:get_nodes
-- @treturn table<index, node> The grid nodes
function M.get_nodes(self)
return self.nodes
end
return M return M