Skip to content

Commit fef6bcd

Browse files
committed
fix creation of layout_opts
1 parent e8482f9 commit fef6bcd

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

Diff for: lapis/request.lua

+3-1
Original file line numberDiff line numberDiff line change
@@ -228,9 +228,11 @@ do
228228
end
229229
end
230230
if self.options.layout == nil then
231-
self.layout_opts = { }
232231
self.options.layout = self.app.layout
233232
end
233+
if self.options.layout then
234+
self.layout_opts = { }
235+
end
234236
local widget_cls = self.options.render
235237
if widget_cls == true then
236238
widget_cls = self.route_name

Diff for: lapis/request.moon

+3-2
Original file line numberDiff line numberDiff line change
@@ -105,13 +105,14 @@ class Request
105105

106106
-- set default layout if none is specified
107107
if @options.layout == nil
108+
@options.layout = @app.layout
109+
110+
if @options.layout
108111
-- NOTE: @layout_opts is a legacy undocumented field, it should be eventually
109112
-- be removed now that @options can communicate the layout being used
110113
-- during view rendering
111114
@layout_opts = {}
112115

113-
@options.layout = @app.layout
114-
115116
widget_cls = @options.render
116117
widget_cls = @route_name if widget_cls == true
117118

0 commit comments

Comments
 (0)