From 2f180bbf98c58d40e46bb243eb3ce7a2c896a415 Mon Sep 17 00:00:00 2001 From: Danila Fedorin Date: Tue, 28 May 2019 22:39:34 -0700 Subject: [PATCH] Properly display forward and back buttons. --- src/CacheSim/View.elm | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/CacheSim/View.elm b/src/CacheSim/View.elm index 2e93718..c14f20b 100644 --- a/src/CacheSim/View.elm +++ b/src/CacheSim/View.elm @@ -133,11 +133,11 @@ viewAccessView m av = currentCache = Maybe.withDefault [] m.hierarchy in div [ class "access-view" ] - [ buttonWrapper + [ viewCacheHierarchy <| effectiveCacheHierarchy currentCache av + , buttonWrapper [ button "Forward" AccessViewForward , button "Back" AccessViewBack ] - , viewCacheHierarchy <| effectiveCacheHierarchy currentCache av ] viewAccessInput : Model -> Html Msg @@ -148,7 +148,7 @@ viewAccessInput m = Just i -> optionalButton True "Access address" (Access i) Nothing -> optionalButton False "Access address" (Access -1) in - div [] + div [ class "access-input" ] [ labeledInput "Access address" m.accessInput ChangeAccessInput , accessButton ] @@ -162,5 +162,6 @@ viewBase m = rawView = viewRawCacheModelHierarchy m.rawHierarchy cacheView = Maybe.withDefault [] <| Maybe.map (List.singleton << viewCacheHierarchy) <| m.hierarchy accessView = Maybe.withDefault [] <| Maybe.map (List.singleton << viewAccessView m) <| m.accessView + accessInputView = [ viewAccessInput m ] in - div [] <| [ rawView, viewAccessInput m] ++ cacheView ++ accessView + div [] <| [ rawView ] ++ cacheView ++ accessView ++ accessInputView