Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
N
nexpie-grafana-theme
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Registry
Registry
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kornkitt Poolsup
nexpie-grafana-theme
Commits
22c9ce7d
Commit
22c9ce7d
authored
Jan 08, 2019
by
Dominik Prokop
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make tooltips persistent when hovered
parent
e03461ce
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
3 deletions
+10
-3
public/app/core/components/Tooltip/Popper.tsx
+4
-2
public/app/core/components/Tooltip/Tooltip.tsx
+6
-1
No files found.
public/app/core/components/Tooltip/Popper.tsx
View file @
22c9ce7d
...
...
@@ -16,7 +16,7 @@ const transitionStyles = {
exiting
:
{
opacity
:
0
},
};
interface
Props
{
interface
Props
extends
React
.
DOMAttributes
<
HTMLDivElement
>
{
renderContent
:
(
content
:
any
)
=>
any
;
show
:
boolean
;
placement
?:
PopperJS
.
Placement
;
...
...
@@ -27,7 +27,7 @@ interface Props {
class
Popper
extends
PureComponent
<
Props
>
{
render
()
{
const
{
renderContent
,
show
,
placement
}
=
this
.
props
;
const
{
renderContent
,
show
,
placement
,
onMouseEnter
,
onMouseLeave
}
=
this
.
props
;
const
{
content
}
=
this
.
props
;
return
(
...
...
@@ -39,6 +39,8 @@ class Popper extends PureComponent<Props> {
{
({
ref
,
style
,
placement
,
arrowProps
})
=>
{
return
(
<
div
onMouseEnter=
{
onMouseEnter
}
onMouseLeave=
{
onMouseLeave
}
ref=
{
ref
}
style=
{
{
...
style
,
...
...
public/app/core/components/Tooltip/Tooltip.tsx
View file @
22c9ce7d
...
...
@@ -12,7 +12,12 @@ const Tooltip = ({ children, renderContent, ...controllerProps }: UsingPopperPro
{
(
showPopper
,
hidePopper
,
popperProps
)
=>
{
return
(
<>
<
Popper
{
...
popperProps
}
referenceElement=
{
tooltipTriggerRef
.
current
}
/>
<
Popper
{
...
popperProps
}
onMouseEnter=
{
showPopper
}
onMouseLeave=
{
hidePopper
}
referenceElement=
{
tooltipTriggerRef
.
current
}
/>
{
React
.
cloneElement
(
children
,
{
ref
:
tooltipTriggerRef
,
onMouseEnter
:
showPopper
,
...
...
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