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
ce97f89d
Unverified
Commit
ce97f89d
authored
Apr 18, 2018
by
Marcus Efraimsson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
make add panel panel scrollbar adjust when panel/dashboard grid are resized
parent
82054e1a
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
22 additions
and
4 deletions
+22
-4
public/app/core/components/ScrollBar/ScrollBar.tsx
+4
-0
public/app/features/dashboard/dashgrid/AddPanelPanel.tsx
+18
-1
public/app/features/dashboard/dashgrid/DashboardGrid.tsx
+0
-3
No files found.
public/app/core/components/ScrollBar/ScrollBar.tsx
View file @
ce97f89d
...
...
@@ -54,6 +54,10 @@ export default class ScrollBar extends React.Component<Props, any> {
return
false
;
}
update
()
{
this
.
scrollbar
.
update
();
}
handleRef
=
ref
=>
{
this
.
container
=
ref
;
};
...
...
public/app/features/dashboard/dashgrid/AddPanelPanel.tsx
View file @
ce97f89d
...
...
@@ -22,10 +22,13 @@ export interface AddPanelPanelState {
}
export
class
AddPanelPanel
extends
React
.
Component
<
AddPanelPanelProps
,
AddPanelPanelState
>
{
private
scrollbar
:
ScrollBar
;
constructor
(
props
)
{
super
(
props
);
this
.
handleCloseAddPanel
=
this
.
handleCloseAddPanel
.
bind
(
this
);
this
.
renderPanelItem
=
this
.
renderPanelItem
.
bind
(
this
);
this
.
panelSizeChanged
=
this
.
panelSizeChanged
.
bind
(
this
);
this
.
state
=
{
panelPlugins
:
this
.
getPanelPlugins
(
''
),
...
...
@@ -35,6 +38,20 @@ export class AddPanelPanel extends React.Component<AddPanelPanelProps, AddPanelP
};
}
componentDidMount
()
{
this
.
props
.
panel
.
events
.
on
(
'panel-size-changed'
,
this
.
panelSizeChanged
);
}
componentWillUnmount
()
{
this
.
props
.
panel
.
events
.
off
(
'panel-size-changed'
,
this
.
panelSizeChanged
);
}
panelSizeChanged
()
{
setTimeout
(()
=>
{
this
.
scrollbar
.
update
();
});
}
getPanelPlugins
(
filter
)
{
let
panels
=
_
.
chain
(
config
.
panels
)
.
filter
({
hideFromList
:
false
})
...
...
@@ -207,7 +224,7 @@ export class AddPanelPanel extends React.Component<AddPanelPanelProps, AddPanelP
<
i
className=
"fa fa-close"
/>
</
button
>
</
div
>
<
ScrollBar
className=
"add-panel__items"
>
<
ScrollBar
ref=
{
element
=>
(
this
.
scrollbar
=
element
)
}
className=
"add-panel__items"
>
<
div
className=
"add-panel__searchbar"
>
<
label
className=
"gf-form gf-form--grow gf-form--has-input-icon"
>
<
input
...
...
public/app/features/dashboard/dashgrid/DashboardGrid.tsx
View file @
ce97f89d
...
...
@@ -140,7 +140,6 @@ export class DashboardGrid extends React.Component<DashboardGridProps, any> {
for
(
const
panel
of
this
.
dashboard
.
panels
)
{
panel
.
resizeDone
();
}
this
.
triggerForceUpdate
();
}
updateGridPos
(
item
,
layout
)
{
...
...
@@ -153,13 +152,11 @@ export class DashboardGrid extends React.Component<DashboardGridProps, any> {
onResize
(
layout
,
oldItem
,
newItem
)
{
this
.
panelMap
[
newItem
.
i
].
updateGridPos
(
newItem
);
this
.
triggerForceUpdate
();
}
onResizeStop
(
layout
,
oldItem
,
newItem
)
{
this
.
updateGridPos
(
newItem
,
layout
);
this
.
panelMap
[
newItem
.
i
].
resizeDone
();
this
.
triggerForceUpdate
();
}
onDragStop
(
layout
,
oldItem
,
newItem
)
{
...
...
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