mirror of
https://github.com/TheAnachronism/docspell.git
synced 2025-06-23 10:58:26 +00:00
Define how many tags to see in ui settings
This commit is contained in:
50
modules/webapp/src/main/elm/Util/ExpandCollapse.elm
Normal file
50
modules/webapp/src/main/elm/Util/ExpandCollapse.elm
Normal file
@ -0,0 +1,50 @@
|
||||
module Util.ExpandCollapse exposing
|
||||
( collapseToggle
|
||||
, expandToggle
|
||||
)
|
||||
|
||||
import Html exposing (..)
|
||||
import Html.Attributes exposing (..)
|
||||
import Html.Events exposing (onClick)
|
||||
|
||||
|
||||
expandToggle : Int -> Int -> msg -> List (Html msg)
|
||||
expandToggle max all m =
|
||||
if max >= all then
|
||||
[]
|
||||
|
||||
else
|
||||
[ a
|
||||
[ class "item"
|
||||
, onClick m
|
||||
, href "#"
|
||||
]
|
||||
[ i [ class "angle down icon" ] []
|
||||
, div [ class "content" ]
|
||||
[ div [ class "description" ]
|
||||
[ em [] [ text "Show More …" ]
|
||||
]
|
||||
]
|
||||
]
|
||||
]
|
||||
|
||||
|
||||
collapseToggle : Int -> Int -> msg -> List (Html msg)
|
||||
collapseToggle max all m =
|
||||
if max >= all then
|
||||
[]
|
||||
|
||||
else
|
||||
[ a
|
||||
[ class "item"
|
||||
, onClick m
|
||||
, href "#"
|
||||
]
|
||||
[ i [ class "angle up icon" ] []
|
||||
, div [ class "content" ]
|
||||
[ div [ class "description" ]
|
||||
[ em [] [ text "Show Less …" ]
|
||||
]
|
||||
]
|
||||
]
|
||||
]
|
Reference in New Issue
Block a user