diff --git a/Examples/DynamicEditor/DynEditorExample.icl b/Examples/DynamicEditor/DynEditorExample.icl index 494ec78a0444ab5d8ee29fa70f8cb99a58545153..fe8755afe2f364cfb7fe407a9e6e9b765bd4498f 100644 --- a/Examples/DynamicEditor/DynEditorExample.icl +++ b/Examples/DynamicEditor/DynEditorExample.icl @@ -264,7 +264,7 @@ taskEditor = DynamicEditor <<@@@ applyHorizontalClasses , functionConsDyn "Not" "not" (dynamic Typed Not :: Typed Func (Bool -> Bool)) - <<@@@ applyHorizontalClasses + <<@@@ applyHorizontalClassesNoBorder ] , DynamicConsGroup "Comparison" [ functionConsDyn "Gt" "greater than" diff --git a/Libraries/iTasks/Extensions/Editors/DynamicEditor.css b/Libraries/iTasks/Extensions/Editors/DynamicEditor.css index 5daa9a69665d68f9a1d972aa53e10aeb64ac06cc..6beeb5f3a984e3e5046c8aa222ec9ad550ff93af 100644 --- a/Libraries/iTasks/Extensions/Editors/DynamicEditor.css +++ b/Libraries/iTasks/Extensions/Editors/DynamicEditor.css @@ -2,3 +2,6 @@ align-self: center; padding: 0.2em; } +.itasks-dynamic-editor-error { + background-color: #FFDDDD; +} diff --git a/Libraries/iTasks/Extensions/Editors/DynamicEditor.icl b/Libraries/iTasks/Extensions/Editors/DynamicEditor.icl index e756b6b7d3c75d19f9c2b429efadef0a4b5d091c..bed22828c692f9595fd29b7bf62d811fdfe2c2b0 100644 --- a/Libraries/iTasks/Extensions/Editors/DynamicEditor.icl +++ b/Libraries/iTasks/Extensions/Editors/DynamicEditor.icl @@ -329,13 +329,16 @@ where = editor.Editor.onEdit (dp ++ [0]) (tp, e) (childSts !! 1) vst = case res of Ok (change, childSt) - # change = ChangeUI [] $ [(0, ChangeChild $ ChangeUI [] [(argIdx + if hideCons 0 1, ChangeChild change)])] ++ mbErrorIconChange + # change = ChangeUI mbErrorIconAttrChange $ [(0, ChangeChild $ ChangeUI [] [(argIdx + if hideCons 0 1, ChangeChild change)])] ++ mbErrorIconChange // replace state for this child = (Ok (change, Just (cid, type, isOk typeIsCorrect), childSts`), vst) where - mbErrorIconChange + (mbErrorIconChange, mbErrorIconAttrChange) = mbErrorIconUpd + mbErrorIconUpd | typeWasCorrect && isError typeIsCorrect = - [(1, InsertChild errorIcon)] + ( [(1, InsertChild errorIcon)] + , [SetAttribute "class" $ JSONArray [JSONString "itasks-container", JSONString "itasks-horizontal", JSONString "itasks-dynamic-editor-error"]] + ) with errorIcon = UI @@ -347,8 +350,8 @@ where [] ] | not typeWasCorrect && isOk typeIsCorrect = - [(1, RemoveChild)] - | otherwise = [] + ([(1, RemoveChild)], [SetAttribute "class" $ JSONArray [JSONString "itasks-container", JSONString "itasks-horizontal"]]) + | otherwise = ([], []) typeIsCorrect = childTypesAreMatching cons.builder (drop 1 childSts`) childSts` = updateAt (argIdx + 1) childSt childSts Error e = (Error e, vst)