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