mirror of
https://github.com/airstruck/luigi.git
synced 2025-12-19 10:26:43 +00:00
context menus working
This commit is contained in:
@@ -43,15 +43,24 @@ Contains the index in `items` of the item being displayed.
|
||||
self.index = 1
|
||||
self.flow = 'x' -- TODO: support vertical stepper
|
||||
|
||||
local contextMenu
|
||||
|
||||
for index, child in ipairs(self) do
|
||||
child.type = child.type or 'stepper.item'
|
||||
self.items[index] = child
|
||||
if child.isContextMenu then
|
||||
contextMenu = child
|
||||
else
|
||||
self.items[index] = child
|
||||
end
|
||||
self[index] = nil
|
||||
end
|
||||
|
||||
local before = self:addChild { type = 'stepper.before' }
|
||||
local view = self:addChild { type = 'stepper.view' }
|
||||
local after = self:addChild { type = 'stepper.after' }
|
||||
if contextMenu then
|
||||
self:addChild(contextMenu)
|
||||
end
|
||||
|
||||
self:onReshape(function (event)
|
||||
if self.flow == 'x' then
|
||||
|
||||
Reference in New Issue
Block a user