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
142
Issues
142
List
Board
Labels
Milestones
Merge Requests
4
Merge Requests
4
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
gargantext
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
Show 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
...
@@ -87,7 +87,8 @@ nodeMainSpan p@{ dispatch, folderOpen, frontends, session } = R.createElement el
pure $ H.span (dropProps droppedFile isDragOver) $
pure $ H.span (dropProps droppedFile isDragOver) $
[ folderIcon nodeType folderOpen
[ folderIcon nodeType folderOpen
, if showBox then
, if showBox then
Popover.popover { open: false
Popover.popover { arrow: false
, open: false
, onClose: \_ -> pure unit
, onClose: \_ -> pure unit
, onOpen: \_ -> pure unit
, onOpen: \_ -> pure unit
, ref: popoverRef } [
, ref: popoverRef } [
...
...
src/Gargantext/Utils/Popover.js
View file @
802b8833
...
@@ -7,6 +7,6 @@ if (typeof window !== 'undefined') {
...
@@ -7,6 +7,6 @@ if (typeof window !== 'undefined') {
}
}
exports
.
popoverCpt
=
popover
;
exports
.
popoverCpt
=
popover
;
exports
.
_setState
=
function
(
el
,
open
)
{
exports
.
_setState
=
function
(
el
,
val
)
{
el
.
setState
(
{
open
:
open
}
);
el
.
setState
(
val
);
}
}
src/Gargantext/Utils/Popover.purs
View file @
802b8833
module Gargantext.Utils.Popover where
module Gargantext.Utils.Popover where
import Data.Maybe (Maybe(..))
import Data.Maybe (Maybe(..)
, maybe
)
import Data.Nullable (Nullable, toMaybe)
import Data.Nullable (Nullable, toMaybe)
import DOM.Simple as DOM
import DOM.Simple as DOM
import DOM.Simple.Console (log2)
import DOM.Simple.Console (log2)
...
@@ -15,7 +15,8 @@ type PopoverRef = R.Ref (Nullable DOM.Element)
...
@@ -15,7 +15,8 @@ type PopoverRef = R.Ref (Nullable DOM.Element)
type Props =
type Props =
(
(
open :: Boolean
arrow :: Boolean
, open :: Boolean
, onClose :: Unit -> Effect Unit
, onClose :: Unit -> Effect Unit
, onOpen :: Unit -> Effect Unit
, onOpen :: Unit -> Effect Unit
, ref :: PopoverRef
, ref :: PopoverRef
...
@@ -26,14 +27,10 @@ foreign import popoverCpt :: R.Component Props
...
@@ -26,14 +27,10 @@ foreign import popoverCpt :: R.Component Props
popover :: Record Props -> Array R.Element -> R.Element
popover :: Record Props -> Array R.Element -> R.Element
popover = R.rawCreateElement popoverCpt
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
setState = runEffectFn2 _setState
setOpen :: PopoverRef -> Boolean -> Effect Unit
setOpen :: PopoverRef -> Boolean -> Effect Unit
setOpen ref val =
setOpen ref val = maybe (pure unit) (\p -> setState p {open: val}) $ toMaybe $ R.readRef ref
case toMaybe $ R.readRef ref of
Nothing -> pure unit
Just p -> do
setState p val
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