Skip to content

Commit

Permalink
fix missing Symbol notation in column, row, cell
Browse files Browse the repository at this point in the history
  • Loading branch information
hhaensel committed Sep 14, 2023
1 parent 8aa57c1 commit b2b4f93
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions src/Layout.jl
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ function container(args...; fluid = false, kwargs...)
Genie.Renderer.Html.div(args...; kwargs...)
end

function flexgrid_kwargs(; class = "", class! = nothing, flexgrid_mappings::Dict{Symbol,Symbol} = Dict{Symbol,Symbol}(), kwargs...)
function flexgrid_kwargs(; class = "", class! = nothing, symbol_class::Bool = true, flexgrid_mappings::Dict{Symbol,Symbol} = Dict{Symbol,Symbol}(), kwargs...)
kwargs = Dict{Symbol,Any}(kwargs...)

# make a classes array that contains strings
Expand Down Expand Up @@ -138,6 +138,11 @@ function flexgrid_kwargs(; class = "", class! = nothing, flexgrid_mappings::Dict

(class isa Symbol || length(class) > 0) && (kwargs[:class] = class)

if ! symbol_class && class isa Symbol
kwargs[:class!] = string(kwargs[:class])
delete!(kwargs, :class)
end

return kwargs
end

Expand Down Expand Up @@ -165,7 +170,7 @@ function row(args...;
col == -1 && size != -1 && (col = size)

class = class isa Symbol ? Symbol("$class + ' row'") : join(pushfirst!(split(class), "row"), " ")
kwargs = flexgrid_kwargs(; class, col, xs, sm, md, lg, xl, kwargs...)
kwargs = flexgrid_kwargs(; class, col, xs, sm, md, lg, xl, symbol_class = false, kwargs...)

Genie.Renderer.Html.div(args...; kwargs...)
end
Expand Down Expand Up @@ -195,7 +200,7 @@ function column(args...;
col == -1 && size != -1 && (col = size)

class = class isa Symbol ? Symbol("$class + ' column'") : join(pushfirst!(split(class), "st-col"), " ")
kwargs = flexgrid_kwargs(; class, col, xs, sm, md, lg, xl, kwargs...)
kwargs = flexgrid_kwargs(; class, col, xs, sm, md, lg, xl, symbol_class = false, kwargs...)

Genie.Renderer.Html.div(args...; kwargs...)
end
Expand Down Expand Up @@ -238,7 +243,7 @@ function cell(args...;
col == 0 && size != 0 && (col = size)

class = class isa Symbol ? Symbol("$class + ' st-col'") : join(pushfirst!(split(class), "st-col"), " ")
kwargs = flexgrid_kwargs(; class, col, xs, sm, md, lg, xl, kwargs...)
kwargs = flexgrid_kwargs(; class, col, xs, sm, md, lg, xl, symbol_class = false, kwargs...)

Genie.Renderer.Html.div(args...; kwargs...)
end
Expand Down

0 comments on commit b2b4f93

Please sign in to comment.