webmcp
diff framework/env/slot/set_layout.lua @ 492:93ebbc1e5dbc
Allow actions to directly return content (e.g. for XMLHttpRequests) by calling slot.set_layout(...) during request handling
author | jbe |
---|---|
date | Tue Jun 27 17:34:02 2017 +0200 (2017-06-27) |
parents | c3d539e33710 |
children | 9f9a67c8f6f5 |
line diff
1.1 --- a/framework/env/slot/set_layout.lua Tue Jun 27 15:38:24 2017 +0200 1.2 +++ b/framework/env/slot/set_layout.lua Tue Jun 27 17:34:02 2017 +0200 1.3 @@ -9,8 +9,12 @@ 1.4 --]]-- 1.5 1.6 function slot.set_layout(layout_ident, content_type) 1.7 + local in_progress = request.is_in_progress() 1.8 request.configure(function() 1.9 slot._current_layout = layout_ident 1.10 slot._content_type = content_type 1.11 + if in_progress then 1.12 + slot._layout_set = true 1.13 + end 1.14 end) 1.15 end