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
e03abde7
Commit
e03abde7
authored
Dec 08, 2017
by
Torkel Ödegaard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
refactoring: #10130
parent
974d4d97
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
24 additions
and
3 deletions
+24
-3
public/app/features/dashboard/dashgrid/DashboardGrid.tsx
+14
-2
public/app/plugins/panel/graph/legend.ts
+1
-1
public/sass/components/_dashboard_grid.scss
+9
-0
No files found.
public/app/features/dashboard/dashgrid/DashboardGrid.tsx
View file @
e03abde7
...
...
@@ -11,7 +11,7 @@ import sizeMe from 'react-sizeme';
let
lastGridWidth
=
1200
;
function
GridWrapper
({
size
,
layout
,
onLayoutChange
,
children
,
onResize
,
onResizeStop
,
onWidthChange
})
{
function
GridWrapper
({
size
,
layout
,
onLayoutChange
,
children
,
onResize
,
onResizeStop
,
onWidthChange
,
className
})
{
if
(
size
.
width
===
0
)
{
console
.
log
(
'size is zero!'
);
}
...
...
@@ -25,7 +25,7 @@ function GridWrapper({size, layout, onLayoutChange, children, onResize, onResize
return
(
<
ReactGridLayout
width=
{
lastGridWidth
}
className=
"layout"
className=
{
className
}
isDraggable=
{
true
}
isResizable=
{
true
}
measureBeforeMount=
{
false
}
...
...
@@ -64,6 +64,8 @@ export class DashboardGrid extends React.Component<DashboardGridProps, any> {
this
.
onResizeStop
=
this
.
onResizeStop
.
bind
(
this
);
this
.
onWidthChange
=
this
.
onWidthChange
.
bind
(
this
);
this
.
state
=
{
animated
:
false
};
// subscribe to dashboard events
this
.
dashboard
=
this
.
panelContainer
.
getDashboard
();
this
.
dashboard
.
on
(
'panel-added'
,
this
.
triggerForceUpdate
.
bind
(
this
));
...
...
@@ -134,6 +136,14 @@ export class DashboardGrid extends React.Component<DashboardGridProps, any> {
this
.
panelMap
[
newItem
.
i
].
resizeDone
();
}
componentDidMount
()
{
setTimeout
(()
=>
{
this
.
setState
(()
=>
{
return
{
animated
:
true
};
});
});
}
renderPanels
()
{
const
panelElements
=
[];
...
...
@@ -150,8 +160,10 @@ export class DashboardGrid extends React.Component<DashboardGridProps, any> {
}
render
()
{
console
.
log
(
'animated'
,
this
.
state
.
animated
);
return
(
<
SizedReactLayoutGrid
className=
{
classNames
({
'layout'
:
true
,
'animated'
:
this
.
state
.
animated
})
}
layout=
{
this
.
buildLayout
()
}
onLayoutChange=
{
this
.
onLayoutChange
}
onWidthChange=
{
this
.
onWidthChange
}
...
...
public/app/plugins/panel/graph/legend.ts
View file @
e03abde7
...
...
@@ -19,7 +19,7 @@ module.directive('graphLegend', function(popoverSrv, $timeout) {
var
legendScrollbar
;
scope
.
$on
(
"$destroy"
,
function
()
{
if
(
!
legendScrollbar
)
{
if
(
legendScrollbar
)
{
legendScrollbar
.
destroy
();
}
});
...
...
public/sass/components/_dashboard_grid.scss
View file @
e03abde7
...
...
@@ -53,3 +53,12 @@
.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