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
802b8833
Commit
802b8833
authored
May 29, 2020
by
Przemyslaw Kaminski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[popover] arrow option, turn it off by default
parent
adb0e070
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
12 deletions
+10
-12
Box.purs
src/Gargantext/Components/Forest/Tree/Node/Box.purs
+2
-1
Popover.js
src/Gargantext/Utils/Popover.js
+2
-2
Popover.purs
src/Gargantext/Utils/Popover.purs
+6
-9
No files found.
src/Gargantext/Components/Forest/Tree/Node/Box.purs
View file @
802b8833
...
...
@@ -87,7 +87,8 @@ nodeMainSpan p@{ dispatch, folderOpen, frontends, session } = R.createElement el
pure $ H.span (dropProps droppedFile isDragOver) $
[ folderIcon nodeType folderOpen
, if showBox then
Popover.popover { open: false
Popover.popover { arrow: false
, open: false
, onClose: \_ -> pure unit
, onOpen: \_ -> pure unit
, ref: popoverRef } [
...
...
src/Gargantext/Utils/Popover.js
View file @
802b8833
...
...
@@ -7,6 +7,6 @@ if (typeof window !== 'undefined') {
}
exports
.
popoverCpt
=
popover
;
exports
.
_setState
=
function
(
el
,
open
)
{
el
.
setState
(
{
open
:
open
}
);
exports
.
_setState
=
function
(
el
,
val
)
{
el
.
setState
(
val
);
}
src/Gargantext/Utils/Popover.purs
View file @
802b8833
module Gargantext.Utils.Popover where
import Data.Maybe (Maybe(..))
import Data.Maybe (Maybe(..)
, maybe
)
import Data.Nullable (Nullable, toMaybe)
import DOM.Simple as DOM
import DOM.Simple.Console (log2)
...
...
@@ -15,7 +15,8 @@ type PopoverRef = R.Ref (Nullable DOM.Element)
type Props =
(
open :: Boolean
arrow :: Boolean
, open :: Boolean
, onClose :: Unit -> Effect Unit
, onOpen :: Unit -> Effect Unit
, ref :: PopoverRef
...
...
@@ -26,14 +27,10 @@ foreign import popoverCpt :: R.Component Props
popover :: Record Props -> Array R.Element -> R.Element
popover = R.rawCreateElement popoverCpt
foreign import _setState ::
EffectFn2 DOM.Element Boolean
Unit
foreign import _setState ::
forall a. EffectFn2 DOM.Element a
Unit
setState ::
DOM.Element -> Boolean
-> Effect Unit
setState ::
forall a. DOM.Element -> a
-> Effect Unit
setState = runEffectFn2 _setState
setOpen :: PopoverRef -> Boolean -> Effect Unit
setOpen ref val =
case toMaybe $ R.readRef ref of
Nothing -> pure unit
Just p -> do
setState p val
setOpen ref val = maybe (pure unit) (\p -> setState p {open: val}) $ toMaybe $ R.readRef ref
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