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
c47c2528
Commit
c47c2528
authored
Feb 06, 2019
by
Johannes Schill
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Revert "chore: Replace sizeMe with AutoSizer in DashboardGrid"
This reverts commit
ae0b027d
.
parent
9c64e3b4
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
18 deletions
+6
-18
public/app/features/dashboard/dashgrid/DashboardGrid.tsx
+6
-18
No files found.
public/app/features/dashboard/dashgrid/DashboardGrid.tsx
View file @
c47c2528
...
...
@@ -5,12 +5,13 @@ import { GRID_CELL_HEIGHT, GRID_CELL_VMARGIN, GRID_COLUMN_COUNT } from 'app/core
import
{
DashboardPanel
}
from
'./DashboardPanel'
;
import
{
DashboardModel
,
PanelModel
}
from
'../state'
;
import
classNames
from
'classnames'
;
import
{
AutoSizer
}
from
'react-virtualized
'
;
import
sizeMe
from
'react-sizeme
'
;
let
lastGridWidth
=
1200
;
let
ignoreNextWidthChange
=
false
;
interface
SizedReactLayoutGridProps
{
interface
GridWrapperProps
{
size
:
{
width
:
number
;
};
layout
:
ReactGridLayout
.
Layout
[];
onLayoutChange
:
(
layout
:
ReactGridLayout
.
Layout
[])
=>
void
;
children
:
JSX
.
Element
|
JSX
.
Element
[];
...
...
@@ -24,12 +25,8 @@ interface SizedReactLayoutGridProps {
isFullscreen
?:
boolean
;
}
interface
GridWrapperProps
extends
SizedReactLayoutGridProps
{
sizedWidth
:
number
;
}
function
GridWrapper
({
size
dWidth
,
size
,
layout
,
onLayoutChange
,
children
,
...
...
@@ -42,7 +39,7 @@ function GridWrapper({
isDraggable
,
isFullscreen
,
}:
GridWrapperProps
)
{
const
width
=
size
dWidth
>
0
?
sizedW
idth
:
lastGridWidth
;
const
width
=
size
.
width
>
0
?
size
.
w
idth
:
lastGridWidth
;
// logic to ignore width changes (optimization)
if
(
width
!==
lastGridWidth
)
{
...
...
@@ -77,16 +74,7 @@ function GridWrapper({
);
}
const
SizedReactLayoutGrid
=
(
props
:
SizedReactLayoutGridProps
)
=>
(
<
AutoSizer
disableHeight
>
{
({
width
})
=>
(
<
GridWrapper
sizedWidth=
{
width
}
{
...
props
}
/>
)
}
</
AutoSizer
>
);
const
SizedReactLayoutGrid
=
sizeMe
({
monitorWidth
:
true
})(
GridWrapper
);
export
interface
DashboardGridProps
{
dashboard
:
DashboardModel
;
...
...
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