mirror of
https://github.com/TheAnachronism/docspell.git
synced 2025-03-31 13:45:09 +00:00
Move field contents when switching search mode in search bar
This commit is contained in:
parent
515bcccc57
commit
aeedf58c2b
@ -208,14 +208,36 @@ update mId key flags settings msg model =
|
|||||||
let
|
let
|
||||||
( sm, mv ) =
|
( sm, mv ) =
|
||||||
Comp.FixedDropdown.update lm model.searchTypeDropdown
|
Comp.FixedDropdown.update lm model.searchTypeDropdown
|
||||||
|
|
||||||
|
m0 =
|
||||||
|
{ model
|
||||||
|
| searchTypeDropdown = sm
|
||||||
|
, searchTypeForm = Maybe.withDefault model.searchTypeForm mv
|
||||||
|
}
|
||||||
|
|
||||||
|
next =
|
||||||
|
case mv of
|
||||||
|
Just BasicSearch ->
|
||||||
|
Just
|
||||||
|
( { m0 | contentOnlySearch = Nothing }
|
||||||
|
, Maybe.withDefault "" model.contentOnlySearch
|
||||||
|
)
|
||||||
|
|
||||||
|
Just ContentOnlySearch ->
|
||||||
|
Just
|
||||||
|
( { m0 | contentOnlySearch = model.searchMenuModel.allNameModel }
|
||||||
|
, ""
|
||||||
|
)
|
||||||
|
|
||||||
|
_ ->
|
||||||
|
Nothing
|
||||||
in
|
in
|
||||||
withSub
|
case next of
|
||||||
( { model
|
Just ( m_, nstr ) ->
|
||||||
| searchTypeDropdown = sm
|
update mId key flags settings (SearchMenuMsg (Comp.SearchMenu.SetAllName nstr)) m_
|
||||||
, searchTypeForm = Maybe.withDefault model.searchTypeForm mv
|
|
||||||
}
|
Nothing ->
|
||||||
, Cmd.none
|
withSub ( m0, Cmd.none )
|
||||||
)
|
|
||||||
|
|
||||||
KeyUpMsg (Just Enter) ->
|
KeyUpMsg (Just Enter) ->
|
||||||
update mId key flags settings DoSearch model
|
update mId key flags settings DoSearch model
|
||||||
|
Loading…
x
Reference in New Issue
Block a user