mirror of
https://github.com/TheAnachronism/docspell.git
synced 2025-06-06 15:15:58 +00:00
Fix edit notes rendering
It must be outside the iframe tree, to not modify it when it appears/disappears.
This commit is contained in:
parent
a5ca3b0325
commit
b8267f60c1
@ -1165,7 +1165,11 @@ view inav model =
|
|||||||
, div
|
, div
|
||||||
[ classList
|
[ classList
|
||||||
[ ( "ui ablue-comp menu", True )
|
[ ( "ui ablue-comp menu", True )
|
||||||
, ( "top attached", model.mailOpen || model.addFilesOpen )
|
, ( "top attached"
|
||||||
|
, model.mailOpen
|
||||||
|
|| model.addFilesOpen
|
||||||
|
|| isEditNotes model.notesField
|
||||||
|
)
|
||||||
]
|
]
|
||||||
]
|
]
|
||||||
[ a [ class "item", Page.href HomePage ]
|
[ a [ class "item", Page.href HomePage ]
|
||||||
@ -1248,6 +1252,7 @@ view inav model =
|
|||||||
]
|
]
|
||||||
, renderMailForm model
|
, renderMailForm model
|
||||||
, renderAddFilesForm model
|
, renderAddFilesForm model
|
||||||
|
, renderNotes model
|
||||||
, div [ class "ui grid" ]
|
, div [ class "ui grid" ]
|
||||||
[ Html.map DeleteItemConfirm (Comp.YesNoDimmer.view model.deleteItemConfirm)
|
[ Html.map DeleteItemConfirm (Comp.YesNoDimmer.view model.deleteItemConfirm)
|
||||||
, div
|
, div
|
||||||
@ -1271,8 +1276,7 @@ view inav model =
|
|||||||
]
|
]
|
||||||
<|
|
<|
|
||||||
List.concat
|
List.concat
|
||||||
[ renderNotes model
|
[ [ renderAttachmentsTabMenu model
|
||||||
, [ renderAttachmentsTabMenu model
|
|
||||||
]
|
]
|
||||||
, renderAttachmentsTabBody model
|
, renderAttachmentsTabBody model
|
||||||
, renderIdInfo model
|
, renderIdInfo model
|
||||||
@ -1297,16 +1301,16 @@ renderIdInfo model =
|
|||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
renderNotes : Model -> List (Html Msg)
|
renderNotes : Model -> Html Msg
|
||||||
renderNotes model =
|
renderNotes model =
|
||||||
case model.notesField of
|
case model.notesField of
|
||||||
HideNotes ->
|
HideNotes ->
|
||||||
case model.item.notes of
|
case model.item.notes of
|
||||||
Nothing ->
|
Nothing ->
|
||||||
[]
|
span [ class "invisible hidden" ] []
|
||||||
|
|
||||||
Just _ ->
|
Just _ ->
|
||||||
[ div [ class "ui segment" ]
|
div [ class "ui segment" ]
|
||||||
[ a
|
[ a
|
||||||
[ class "ui top left attached label"
|
[ class "ui top left attached label"
|
||||||
, onClick ToggleNotes
|
, onClick ToggleNotes
|
||||||
@ -1316,15 +1320,14 @@ renderNotes model =
|
|||||||
, text "Show notes…"
|
, text "Show notes…"
|
||||||
]
|
]
|
||||||
]
|
]
|
||||||
]
|
|
||||||
|
|
||||||
ViewNotes ->
|
ViewNotes ->
|
||||||
case model.item.notes of
|
case model.item.notes of
|
||||||
Nothing ->
|
Nothing ->
|
||||||
[]
|
span [ class "hidden invisible" ] []
|
||||||
|
|
||||||
Just str ->
|
Just str ->
|
||||||
[ div [ class "ui segment" ]
|
div [ class "ui segment" ]
|
||||||
[ Markdown.toHtml [ class "item-notes" ] str
|
[ Markdown.toHtml [ class "item-notes" ] str
|
||||||
, a
|
, a
|
||||||
[ class "ui left corner label"
|
[ class "ui left corner label"
|
||||||
@ -1334,10 +1337,9 @@ renderNotes model =
|
|||||||
[ i [ class "eye slash icon" ] []
|
[ i [ class "eye slash icon" ] []
|
||||||
]
|
]
|
||||||
]
|
]
|
||||||
]
|
|
||||||
|
|
||||||
EditNotes mm ->
|
EditNotes mm ->
|
||||||
[ div [ class "ui segment" ]
|
div [ class "ui bottom attached segment" ]
|
||||||
[ Html.map NotesEditMsg (Comp.MarkdownInput.view (Maybe.withDefault "" model.notesModel) mm)
|
[ Html.map NotesEditMsg (Comp.MarkdownInput.view (Maybe.withDefault "" model.notesModel) mm)
|
||||||
, div [ class "ui secondary menu" ]
|
, div [ class "ui secondary menu" ]
|
||||||
[ a
|
[ a
|
||||||
@ -1358,7 +1360,6 @@ renderNotes model =
|
|||||||
]
|
]
|
||||||
]
|
]
|
||||||
]
|
]
|
||||||
]
|
|
||||||
|
|
||||||
|
|
||||||
attachmentVisible : Model -> Int -> Bool
|
attachmentVisible : Model -> Int -> Bool
|
||||||
|
Loading…
x
Reference in New Issue
Block a user