liquid_feedback_frontend
view env/ui/box_row.lua @ 211:4993b71b383f
First checkin of lf2 (frontend second generation) prototype
author | bsw |
---|---|
date | Wed Mar 02 20:06:26 2011 +0100 (2011-03-02) |
parents | |
children | 1dab81353eb1 |
line source
1 function ui.box_row(args)
2 app.ui_box_col = 1
3 local class = "row"
4 if args.class then class = class .. " " .. args.class end
5 if app.ui_box_row == 1 then class = class .. " first" end
6 if app.ui_box_row == app.ui_box_row_count then class = class .. " last" end
7 if args.toggle_content then class = class .. " toggled" end
8 ui.container{ attr = { class = class }, content = function()
9 if args.toggle_content then
10 ui.container{ attr = { class = "col toggle"}, content = function()
11 if type(args.toggle_content) == "function" then
12 args.toggle_content()
13 else
14 slot.put(encode.html(args.toggle_content))
15 end
16 end }
17 end
18 if type(args.content) == "function" then
19 args.content()
20 else
21 slot.put(encode.html(args.content))
22 end
23 end }
24 app.ui_box_row = app.ui_box_row + 1
25 end