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
548708a8
Commit
548708a8
authored
Jan 17, 2019
by
Torkel Ödegaard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Scroll to top when visualization picker is opened
parent
9cb49d14
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
3 deletions
+11
-3
public/app/features/dashboard/panel_editor/VisualizationTab.tsx
+11
-3
No files found.
public/app/features/dashboard/panel_editor/VisualizationTab.tsx
View file @
548708a8
...
...
@@ -26,6 +26,7 @@ interface Props {
interface
State
{
isVizPickerOpen
:
boolean
;
searchQuery
:
string
;
scrollTop
:
number
;
}
export
class
VisualizationTab
extends
PureComponent
<
Props
,
State
>
{
...
...
@@ -39,6 +40,7 @@ export class VisualizationTab extends PureComponent<Props, State> {
this
.
state
=
{
isVizPickerOpen
:
false
,
searchQuery
:
''
,
scrollTop
:
0
,
};
}
...
...
@@ -143,7 +145,7 @@ export class VisualizationTab extends PureComponent<Props, State> {
};
onOpenVizPicker
=
()
=>
{
this
.
setState
({
isVizPickerOpen
:
true
});
this
.
setState
({
isVizPickerOpen
:
true
,
scrollTop
:
0
});
};
onCloseVizPicker
=
()
=>
{
...
...
@@ -201,9 +203,14 @@ export class VisualizationTab extends PureComponent<Props, State> {
renderHelp
=
()
=>
<
PluginHelp
plugin=
{
this
.
props
.
plugin
}
type=
"help"
/>;
setScrollTop
=
(
event
:
React
.
MouseEvent
<
HTMLElement
>
)
=>
{
const
target
=
event
.
target
as
HTMLElement
;
this
.
setState
({
scrollTop
:
target
.
scrollTop
});
};
render
()
{
const
{
plugin
}
=
this
.
props
;
const
{
isVizPickerOpen
,
searchQuery
}
=
this
.
state
;
const
{
isVizPickerOpen
,
searchQuery
,
scrollTop
}
=
this
.
state
;
const
pluginHelp
:
EditorToolbarView
=
{
heading
:
'Help'
,
...
...
@@ -212,7 +219,8 @@ export class VisualizationTab extends PureComponent<Props, State> {
};
return
(
<
EditorTabBody
heading=
"Visualization"
renderToolbar=
{
this
.
renderToolbar
}
toolbarItems=
{
[
pluginHelp
]
}
>
<
EditorTabBody
heading=
"Visualization"
renderToolbar=
{
this
.
renderToolbar
}
toolbarItems=
{
[
pluginHelp
]
}
scrollTop=
{
scrollTop
}
setScrollTop=
{
this
.
setScrollTop
}
>
<>
<
FadeIn
in=
{
isVizPickerOpen
}
duration=
{
200
}
unmountOnExit=
{
true
}
>
<
VizTypePicker
...
...
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