bsw@211: function ui.box_row(args) bsw@211: app.ui_box_col = 1 bsw@211: local class = "row" bsw@211: if args.class then class = class .. " " .. args.class end bsw@211: if app.ui_box_row == 1 then class = class .. " first" end bsw@211: if app.ui_box_row == app.ui_box_row_count then class = class .. " last" end bsw@211: if args.toggle_content then class = class .. " toggled" end bsw@211: ui.container{ attr = { class = class }, content = function() bsw@211: if args.toggle_content then bsw@211: ui.container{ attr = { class = "col toggle"}, content = function() bsw@211: if type(args.toggle_content) == "function" then bsw@211: args.toggle_content() bsw@211: else bsw@211: slot.put(encode.html(args.toggle_content)) bsw@211: end bsw@211: end } bsw@211: end bsw@211: if type(args.content) == "function" then bsw@211: args.content() bsw@211: else bsw@211: slot.put(encode.html(args.content)) bsw@211: end bsw@211: end } bsw@211: app.ui_box_row = app.ui_box_row + 1 bsw@211: end