attrib "key" -> "shortcut", also fix #20

This commit is contained in:
airstruck
2016-01-03 01:18:04 -05:00
parent 3abcce1615
commit c73833337e
12 changed files with 98 additions and 90 deletions

View File

@@ -41,26 +41,16 @@ Contains the index in `items` of the item being displayed.
self.items = {}
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'
if child.isContextMenu then
contextMenu = child
else
self.items[index] = child
end
self.items[index] = child
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