diff --git a/src/Page/Options.elm b/src/Page/Options.elm index 725a51d..fefae4a 100644 --- a/src/Page/Options.elm +++ b/src/Page/Options.elm @@ -154,6 +154,9 @@ viewResultItem channel show item = else [] + + open = + SearchMsg (Search.ShowDetails item.source.name) in [] -- DEBUG: |> List.append @@ -175,10 +178,22 @@ viewResultItem channel show item = -- DEBUG: ] |> List.append (tr - [ onClick (SearchMsg (Search.ShowDetails item.source.name)) + [ onClick open , Search.elementId item.source.name ] - [ td [] [ text item.source.name ] + [ td [] + [ Html.button + [ class "search-result-button" + , Html.Events.custom "click" <| + Json.Decode.succeed + { message = open + , stopPropagation = True + , preventDefault = True + } + ] + [ text item.source.name + ] + ] ] :: packageDetails ) diff --git a/src/Page/Packages.elm b/src/Page/Packages.elm index 5ba928c..e9189b7 100644 --- a/src/Page/Packages.elm +++ b/src/Page/Packages.elm @@ -194,6 +194,9 @@ viewResultItem channel show item = else [] + + open = + SearchMsg (Search.ShowDetails item.source.attr_name) in [] -- DEBUG: |> List.append @@ -222,10 +225,21 @@ viewResultItem channel show item = -- DEBUG: ] |> List.append (tr - [ onClick (SearchMsg (Search.ShowDetails item.source.attr_name)) + [ onClick open , Search.elementId item.source.attr_name ] - [ td [] [ text <| item.source.attr_name ] + [ td [] + [ Html.button + [ class "search-result-button" + , Html.Events.custom "click" <| + Json.Decode.succeed + { message = open + , stopPropagation = True + , preventDefault = True + } + ] + [ text item.source.attr_name ] + ] , td [] [ text item.source.pname ] , td [] [ text item.source.pversion ] , td [] [ text <| Maybe.withDefault "" item.source.description ] diff --git a/src/index.less b/src/index.less index d197cb3..c9e5553 100644 --- a/src/index.less +++ b/src/index.less @@ -88,6 +88,17 @@ header .navbar.navbar-static-top { tbody > td > dl > dd { margin-bottom: 1em; } + + .search-result-button { + margin: 0; + padding: 0; + border: 0; + background: transparent; + display: inline; + font: inherit; + color: inherit; + text-align: inherit; + } } .sort-form,