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
974d4d97
Commit
974d4d97
authored
Dec 08, 2017
by
Torkel Ödegaard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Revert "Don't animate panels on initial render (#10130)"
This reverts commit
e0c173c5
.
parent
b59d06ca
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
58 deletions
+27
-58
public/app/features/dashboard/dashgrid/DashboardGrid.tsx
+27
-49
public/sass/components/_dashboard_grid.scss
+0
-9
No files found.
public/app/features/dashboard/dashgrid/DashboardGrid.tsx
View file @
974d4d97
...
...
@@ -11,59 +11,37 @@ import sizeMe from 'react-sizeme';
let
lastGridWidth
=
1200
;
export
interface
GridWrapperProps
{
size
:
any
;
layout
:
any
;
children
:
any
;
onResize
:
any
;
onResizeStop
:
any
;
onWidthChange
:
any
;
onLayoutChange
:
any
;
}
class
GridWrapper
extends
React
.
Component
<
GridWrapperProps
,
any
>
{
animated
:
boolean
;
constructor
(
props
)
{
super
(
props
);
if
(
this
.
props
.
size
.
width
===
0
)
{
console
.
log
(
'size is zero!'
);
}
const
width
=
this
.
props
.
size
.
width
>
0
?
this
.
props
.
size
.
width
:
lastGridWidth
;
if
(
width
!==
lastGridWidth
)
{
this
.
props
.
onWidthChange
();
lastGridWidth
=
width
;
}
function
GridWrapper
({
size
,
layout
,
onLayoutChange
,
children
,
onResize
,
onResizeStop
,
onWidthChange
})
{
if
(
size
.
width
===
0
)
{
console
.
log
(
'size is zero!'
);
}
componentDidMount
()
{
// Disable animation on initial rendering and enable it when component has been mounted.
this
.
animated
=
true
;
const
width
=
size
.
width
>
0
?
size
.
width
:
lastGridWidth
;
if
(
width
!==
lastGridWidth
)
{
onWidthChange
();
lastGridWidth
=
width
;
}
render
()
{
return
(
<
ReactGridLayout
width=
{
lastGridWidth
}
className=
{
this
.
animated
?
'layout animated'
:
'layout'
}
isDraggable=
{
true
}
isResizable=
{
true
}
measureBeforeMount=
{
false
}
containerPadding=
{
[
0
,
0
]
}
useCSSTransforms=
{
true
}
margin=
{
[
GRID_CELL_VMARGIN
,
GRID_CELL_VMARGIN
]
}
cols=
{
GRID_COLUMN_COUNT
}
rowHeight=
{
GRID_CELL_HEIGHT
}
draggableHandle=
".grid-drag-handle"
layout=
{
this
.
props
.
layout
}
onResize=
{
this
.
props
.
onResize
}
onResizeStop=
{
this
.
props
.
onResizeStop
}
onLayoutChange=
{
this
.
props
.
onLayoutChange
}
>
{
this
.
props
.
children
}
</
ReactGridLayout
>
);
}
return
(
<
ReactGridLayout
width=
{
lastGridWidth
}
className=
"layout"
isDraggable=
{
true
}
isResizable=
{
true
}
measureBeforeMount=
{
false
}
containerPadding=
{
[
0
,
0
]
}
useCSSTransforms=
{
true
}
margin=
{
[
GRID_CELL_VMARGIN
,
GRID_CELL_VMARGIN
]
}
cols=
{
GRID_COLUMN_COUNT
}
rowHeight=
{
GRID_CELL_HEIGHT
}
draggableHandle=
".grid-drag-handle"
layout=
{
layout
}
onResize=
{
onResize
}
onResizeStop=
{
onResizeStop
}
onLayoutChange=
{
onLayoutChange
}
>
{
children
}
</
ReactGridLayout
>
);
}
const
SizedReactLayoutGrid
=
sizeMe
({
monitorWidth
:
true
})(
GridWrapper
);
...
...
public/sass/components/_dashboard_grid.scss
View file @
974d4d97
...
...
@@ -53,12 +53,3 @@
.react-grid-item.react-draggable-dragging.panel
{
z-index
:
$zindex-dropdown
;
}
// Disable animation on initial rendering and enable it when component has been mounted.
.react-grid-item.cssTransforms.panel
{
transition-property
:
none
;
}
.animated
.react-grid-item.cssTransforms.panel
{
transition-property
:
transform
;
}
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