Commit 9d903359 authored by Mart Lubbers's avatar Mart Lubbers

Fix runtime error for ApplyAttribute with class

<<@ ApplyAttribute "class" "bork"
results in a JSONString instead of an JSONArray on which it didn't match
parent 9c4a5a82
Pipeline #27378 canceled with stage
in 2 minutes and 48 seconds
......@@ -20,10 +20,12 @@ from Text import class Text, instance Text String
addCSSClass :: String -> LayoutRule
addCSSClass className = modifyUIAttributes (SelectKeys ["class"]) add
add attr = 'DM'.put "class" (maybe
add attr = 'DM'.put "class" (maybe
(JSONArray [JSONString className])
(\(JSONArray classNames) -> JSONArray (classNames ++ [JSONString className]))
('DM'.get "class" attr)) attr
(\v->case v of
(JSONArray classNames) = JSONArray (classNames ++ [JSONString className])
(JSONString s) = JSONArray [JSONString s, JSONString className]
) ('DM'.get "class" attr)) attr
arrangeWithTabs :: Bool -> LayoutRule
arrangeWithTabs closeable = layoutSubUIs
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment