Properly display forward and back buttons.

This commit is contained in:
Danila Fedorin 2019-05-28 22:39:34 -07:00
parent 7cababbe67
commit 2f180bbf98

View File

@ -133,11 +133,11 @@ viewAccessView m av =
currentCache = Maybe.withDefault [] m.hierarchy currentCache = Maybe.withDefault [] m.hierarchy
in in
div [ class "access-view" ] div [ class "access-view" ]
[ buttonWrapper [ viewCacheHierarchy <| effectiveCacheHierarchy currentCache av
, buttonWrapper
[ button "Forward" AccessViewForward [ button "Forward" AccessViewForward
, button "Back" AccessViewBack , button "Back" AccessViewBack
] ]
, viewCacheHierarchy <| effectiveCacheHierarchy currentCache av
] ]
viewAccessInput : Model -> Html Msg viewAccessInput : Model -> Html Msg
@ -148,7 +148,7 @@ viewAccessInput m =
Just i -> optionalButton True "Access address" (Access i) Just i -> optionalButton True "Access address" (Access i)
Nothing -> optionalButton False "Access address" (Access -1) Nothing -> optionalButton False "Access address" (Access -1)
in in
div [] div [ class "access-input" ]
[ labeledInput "Access address" m.accessInput ChangeAccessInput [ labeledInput "Access address" m.accessInput ChangeAccessInput
, accessButton , accessButton
] ]
@ -162,5 +162,6 @@ viewBase m =
rawView = viewRawCacheModelHierarchy m.rawHierarchy rawView = viewRawCacheModelHierarchy m.rawHierarchy
cacheView = Maybe.withDefault [] <| Maybe.map (List.singleton << viewCacheHierarchy) <| m.hierarchy cacheView = Maybe.withDefault [] <| Maybe.map (List.singleton << viewCacheHierarchy) <| m.hierarchy
accessView = Maybe.withDefault [] <| Maybe.map (List.singleton << viewAccessView m) <| m.accessView accessView = Maybe.withDefault [] <| Maybe.map (List.singleton << viewAccessView m) <| m.accessView
accessInputView = [ viewAccessInput m ]
in in
div [] <| [ rawView, viewAccessInput m] ++ cacheView ++ accessView div [] <| [ rawView ] ++ cacheView ++ accessView ++ accessInputView