From 62a2a8a5827183b1846d31dc9cd61b3fd05ff19e Mon Sep 17 00:00:00 2001 From: Louis Lebrault Date: Mon, 6 Dec 2021 21:14:23 +0100 Subject: [PATCH] Move results before left anchors in tab focus order --- html/hoogle.css | 4 ++++ src/Action/Server.hs | 7 ++++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/html/hoogle.css b/html/hoogle.css index 966216d5..f6ae92bd 100644 --- a/html/hoogle.css +++ b/html/hoogle.css @@ -18,6 +18,7 @@ body { #body { flex-grow: 1; + position: relative; } a img { @@ -127,6 +128,9 @@ form { padding: 0px; margin-left: 10px; overflow: hidden; + position: absolute; + top: 0; + left: 0; } #left li { diff --git a/src/Action/Server.hs b/src/Action/Server.hs index 935cc313..f623d7d8 100644 --- a/src/Action/Server.hs +++ b/src/Action/Server.hs @@ -189,9 +189,6 @@ dedupeTake n key = f [] Map.empty showResults :: Bool -> Bool -> Maybe FilePath -> [(String, String)] -> [Query] -> [[Target]] -> Markup showResults local links haddock args query results = do H.h1 $ renderQuery query - H.ul ! H.id "left" $ do - H.li $ H.b "Packages" - mconcat [H.li $ f cat val | (cat,val) <- itemCategories $ concat results, QueryScope True cat val `notElem` query] when (null results) $ H.p "No results found" forM_ results $ \is@(Target{..}:_) -> do H.div ! H.class_ "result" $ do @@ -203,6 +200,10 @@ showResults local links haddock args query results = do H.div ! H.class_ "links" $ H.a ! H.href (H.stringValue link) $ "Uses" H.div ! H.class_ "from" $ showFroms local haddock is H.div ! H.class_ "doc newline shut" $ H.preEscapedString targetDocs + H.ul ! H.id "left" $ do + H.li $ H.b "Packages" + mconcat [H.li $ f cat val | (cat,val) <- itemCategories $ concat results, QueryScope True cat val `notElem` query] + where useLink :: [Target] -> Maybe String useLink [t] | isNothing $ targetPackage t =