Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
purescript-gargantext
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Grégoire Locqueville
purescript-gargantext
Commits
f32774ac
Commit
f32774ac
authored
Jun 26, 2019
by
Przemyslaw Kaminski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[NgramsTree] some styling fixes to context menu
parent
d6aa4382
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
22 additions
and
33 deletions
+22
-33
context-menu.css
dist/styles/context-menu.css
+9
-27
Menu.purs
src/Gargantext/Components/Annotation/Menu.purs
+1
-1
ContextMenu.purs
src/Gargantext/Components/ContextMenu/ContextMenu.purs
+12
-5
No files found.
dist/styles/context-menu.css
View file @
f32774ac
.context-menu
{
display
:
block
;
position
:
fixed
;
z-index
:
9999
;
background
:
#fff
;
border
:
1px
solid
#000
;
border-radius
:
3px
;
padding
:
0
;
position
:
absolute
;
left
:
96px
;
top
:
-64px
;
background-color
:
white
;
z-index
:
1000
;
}
.context-menu-items
{
display
:
block
;
position
:
relative
;
margin
:
0
;
padding
:
0
;
}
.context-menu-item
{
display
:
block
;
margin
:
10px
;
text-align
:
center
;
margin
:
0
;
padding
:
0
;
cursor
:
pointer
;
}
.context-menu-item
a
{
display
:
block
;
padding
:
10px
20px
;
text-align
:
center
;
font-size
:
16px
;
height
:
100%
;
.context-menu
a
.list-group-item
{
cursor
:
pointer
;
}
.search-bar-container
{
margin-top
:
11px
;
text-align
:
center
;
...
...
src/Gargantext/Components/Annotation/Menu.purs
View file @
f32774ac
...
...
@@ -50,5 +50,5 @@ addToList {menuType, setList} t = Just $ CM.contextMenuItem [ link ]
link = HTML.a { onClick: click, className: className } [ HTML.text (label menuType) ]
label NewNgram = "Add to " <> termListName t
label SetTermListItem = "Change to" <> termListName t
className =
termClass t
className =
"list-group-item " <> (termClass t)
click = mkEffectFn1 $ \_ -> setList t
src/Gargantext/Components/ContextMenu/ContextMenu.purs
View file @
f32774ac
...
...
@@ -19,7 +19,7 @@ import DOM.Simple.Document as Document
import DOM.Simple.Types ( DOMRect )
import Effect (Effect)
import Effect.Uncurried ( mkEffectFn1 )
import FFI.Simple ( (...), (..), delay )
import FFI.Simple ( (...), (..),
(.=),
delay )
import Reactix as R
import Reactix.DOM.HTML as HTML
import Reactix.SyntheticEvent as E
...
...
@@ -47,10 +47,17 @@ contextMenuCpt = R.hooksComponent "ContextMenu" cpt
(toMaybe $ R.readRef root)
pure $ \_ -> pure unit
R.useLayoutEffect2 root rect (contextMenuEffect menu.setMenu root)
let cs = [ HTML.ul { className: "context-menu-items" } children ]
let cs = [
HTML.div { className: "popover-content" }
[ HTML.div { className: "panel panel-default" }
[ HTML.ul { className: "list-group" }
children
]
]
]
pure $ R.createPortal [ elems root menu rect $ cs ] host
elems ref menu (Just rect) = HTML.
nav { ref , className: "context-menu", style: position menu rect}
elems ref _ _ = HTML.
nav { ref, className: "context-menu" }
elems ref menu (Just rect) = HTML.
div (({ ref , className: "context-menu", style: position menu rect} .= "data-toggle" $ "popover") .= "data-placement" $ "right")
elems ref _ _ = HTML.
div (({ ref, className: "context-menu" } .= "data-toggle" $ "popover") .= "data-placement" $ "right")
contextMenuEffect
:: forall t
...
...
@@ -68,7 +75,7 @@ contextMenuEffect setMenu rootRef _ =
DOM.removeEventListener document "click" onClick
DOM.removeEventListener document "scroll" onScroll
Nothing -> pure $ \_ -> pure unit
documentClickHandler :: forall t. (Maybe t -> Effect Unit) -> DOM.Element -> Callback DE.MouseEvent
documentClickHandler hide menu =
R2.named "hideMenuOnClickOutside" $ callback $ \e ->
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment