Skip to content

Commit

Permalink
support pagetemplate, rename init_webchannel
Browse files Browse the repository at this point in the history
  • Loading branch information
hhaensel committed Nov 9, 2024
1 parent 98727ab commit 737c2e4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/Layout.jl
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ julia> page(:elemid, [
```
"""
function page(model::Union{M, Vector{M}}, args...;
pagetemplate = (x...) -> join([x...], '\n'),
partial::Bool = false, title::String = "", class::String = "container", style::String = "",
channel::String = Genie.config.webchannels_default_route, head_content::Union{AbstractString, Vector{<:AbstractString}} = "",
prepend::Union{S,Vector} = "", append::Union{T,Vector} = [],
Expand All @@ -100,7 +101,7 @@ function page(model::Union{M, Vector{M}}, args...;
layout(
[
join(prepend)
[Genie.Renderer.Html.div(id = vm(m), ui, args[2:end]...; class = class, kwargs...) for (m, ui) in zip(model, uis)]...
pagetemplate([Genie.Renderer.Html.div(id = vm(m), ui, args[2:end]...; class = class, kwargs...) for (m, ui) in zip(model, uis)]...)
join(append)
], model;
partial = partial, title = title, style = style, head_content = head_content, channel = channel,
Expand Down
2 changes: 1 addition & 1 deletion src/Stipple.jl
Original file line number Diff line number Diff line change
Expand Up @@ -849,7 +849,7 @@ end
function channelscript(channel::String) :: String
Genie.Renderer.Html.script(["""
window.CHANNEL = '$(channel)';
if (window.Genie) Genie.init_webchannel('$(channel)');
if (window.Genie) Genie.initWebChannel('$(channel)');
"""])
end

Expand Down

0 comments on commit 737c2e4

Please sign in to comment.