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
2a5f7d1e
Commit
2a5f7d1e
authored
Nov 15, 2018
by
Johannes Schill
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
panel-header: Add fade in transition to tooltip
parent
e73466a8
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
2 deletions
+27
-2
public/app/core/components/Tooltip/Popper.tsx
+27
-2
No files found.
public/app/core/components/Tooltip/Popper.tsx
View file @
2a5f7d1e
import
React
,
{
PureComponent
}
from
'react'
;
import
{
Manager
,
Popper
as
ReactPopper
,
Reference
}
from
'react-popper'
;
import
Transition
from
'react-transition-group/Transition'
;
const
defaultTransitionStyles
=
{
transition
:
'opacity 200ms linear'
,
opacity
:
0
,
};
const
transitionStyles
=
{
exited
:
{
opacity
:
0
},
entering
:
{
opacity
:
0
},
entered
:
{
opacity
:
1
},
exiting
:
{
opacity
:
0
},
};
interface
Props
{
renderContent
:
(
content
:
any
)
=>
any
;
...
...
@@ -13,6 +26,7 @@ class Popper extends PureComponent<Props> {
render
()
{
const
{
children
,
renderContent
,
show
,
placement
,
refClassName
}
=
this
.
props
;
const
{
content
}
=
this
.
props
;
return
(
<
Manager
>
<
Reference
>
...
...
@@ -22,11 +36,21 @@ class Popper extends PureComponent<Props> {
</
div
>
)
}
</
Reference
>
{
show
&&
(
<
Transition
in=
{
show
}
timeout=
{
100
}
>
{
transitionState
=>
(
<
ReactPopper
placement=
{
placement
}
>
{
({
ref
,
style
,
placement
,
arrowProps
})
=>
{
return
(
<
div
ref=
{
ref
}
style=
{
style
}
data
-
placement=
{
placement
}
className=
"popper"
>
<
div
ref=
{
ref
}
style=
{
{
...
style
,
...
defaultTransitionStyles
,
...
transitionStyles
[
transitionState
],
}
}
data
-
placement=
{
placement
}
className=
"popper"
>
<
div
className=
"popper__background"
>
{
renderContent
(
content
)
}
<
div
ref=
{
arrowProps
.
ref
}
data
-
placement=
{
placement
}
className=
"popper__arrow"
/>
...
...
@@ -36,6 +60,7 @@ class Popper extends PureComponent<Props> {
}
}
</
ReactPopper
>
)
}
</
Transition
>
</
Manager
>
);
}
...
...
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