Fix reset search for content-only and provide it on top bar

This commit is contained in:
Eike Kettner 2020-11-14 10:41:20 +01:00
parent 795cd8bc80
commit ee6b54006c
2 changed files with 39 additions and 28 deletions

View File

@ -47,6 +47,7 @@ update mId key flags settings msg model =
{ model { model
| searchOffset = 0 | searchOffset = 0
, searchType = defaultSearchType flags , searchType = defaultSearchType flags
, contentOnlySearch = Nothing
} }
in in
update mId key flags settings (SearchMenuMsg Comp.SearchMenu.ResetForm) nm update mId key flags settings (SearchMenuMsg Comp.SearchMenu.ResetForm) nm

View File

@ -311,39 +311,49 @@ viewSearchBar flags model =
] ]
[ i [ class "filter icon" ] [] [ i [ class "filter icon" ] []
] ]
, div [ class "right fitted item" ] , div [ class "right menu" ]
[ div [ class "ui left icon right action input" ] [ div [ class "fitted item" ]
[ i [ div [ class "ui left icon right action input" ]
[ classList [ i
[ ( "search link icon", not model.searchInProgress ) [ classList
, ( "loading spinner icon", model.searchInProgress ) [ ( "search link icon", not model.searchInProgress )
] , ( "loading spinner icon", model.searchInProgress )
, href "#"
, onClick DoSearch
]
(if hasMoreSearch model && model.searchTypeForm == BasicSearch then
[ i [ class "icons search-corner-icons" ]
[ i [ class "tiny blue circle icon" ] []
] ]
, href "#"
, onClick DoSearch
] ]
(if hasMoreSearch model && model.searchTypeForm == BasicSearch then
[ i [ class "icons search-corner-icons" ]
[ i [ class "tiny blue circle icon" ] []
]
]
else else
[]
)
, input
[ type_ "text"
, placeholder "Quick Search "
, onInput SetBasicSearch
, Util.Html.onKeyUpCode KeyUpMsg
, Maybe.map value searchInput
|> Maybe.withDefault (value "")
]
[] []
) , Html.map SearchTypeMsg
, input (Comp.FixedDropdown.viewStyled searchTypeClass
[ type_ "text" (Just searchTypeItem)
, placeholder "Quick Search " model.searchTypeDropdown
, onInput SetBasicSearch )
, Util.Html.onKeyUpCode KeyUpMsg , a
, Maybe.map value searchInput [ class "ui icon basic button"
|> Maybe.withDefault (value "") , href "#"
, onClick ResetSearch
, title "Reset search form"
]
[ i [ class "undo icon" ] []
]
] ]
[]
, Html.map SearchTypeMsg
(Comp.FixedDropdown.viewStyled searchTypeClass
(Just searchTypeItem)
model.searchTypeDropdown
)
] ]
] ]
] ]