liquid_feedback_frontend
diff 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 diff
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/env/ui/box_row.lua Wed Mar 02 20:06:26 2011 +0100 1.3 @@ -0,0 +1,25 @@ 1.4 +function ui.box_row(args) 1.5 + app.ui_box_col = 1 1.6 + local class = "row" 1.7 + if args.class then class = class .. " " .. args.class end 1.8 + if app.ui_box_row == 1 then class = class .. " first" end 1.9 + if app.ui_box_row == app.ui_box_row_count then class = class .. " last" end 1.10 + if args.toggle_content then class = class .. " toggled" end 1.11 + ui.container{ attr = { class = class }, content = function() 1.12 + if args.toggle_content then 1.13 + ui.container{ attr = { class = "col toggle"}, content = function() 1.14 + if type(args.toggle_content) == "function" then 1.15 + args.toggle_content() 1.16 + else 1.17 + slot.put(encode.html(args.toggle_content)) 1.18 + end 1.19 + end } 1.20 + end 1.21 + if type(args.content) == "function" then 1.22 + args.content() 1.23 + else 1.24 + slot.put(encode.html(args.content)) 1.25 + end 1.26 + end } 1.27 + app.ui_box_row = app.ui_box_row + 1 1.28 +end