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
55609382
Commit
55609382
authored
Dec 09, 2017
by
Torkel Ödegaard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: fixed panel size rerendering issues
parent
47014ddb
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
16 deletions
+14
-16
public/app/features/dashboard/view_state_srv.ts
+1
-1
public/app/features/panel/panel_ctrl.ts
+0
-10
public/app/features/panel/panel_directive.ts
+13
-5
No files found.
public/app/features/dashboard/view_state_srv.ts
View file @
55609382
...
...
@@ -75,7 +75,7 @@ export class DashboardViewState {
}
// remember if editStateChanged
this
.
editStateChanged
=
state
.
edit
!==
this
.
state
.
edit
;
this
.
editStateChanged
=
(
state
.
edit
||
false
)
!==
(
this
.
state
.
edit
||
false
)
;
_
.
extend
(
this
.
state
,
state
);
this
.
dashboard
.
meta
.
fullscreen
=
this
.
state
.
fullscreen
;
...
...
public/app/features/panel/panel_ctrl.ts
View file @
55609382
...
...
@@ -52,12 +52,9 @@ export class PanelCtrl {
this
.
events
.
emit
(
'panel-teardown'
);
this
.
events
.
removeAllListeners
();
});
this
.
calculatePanelHeight
();
}
init
()
{
this
.
events
.
on
(
'panel-size-changed'
,
this
.
onSizeChanged
.
bind
(
this
));
this
.
events
.
emit
(
'panel-initialized'
);
this
.
publishAppEvent
(
'panel-initialized'
,
{
scope
:
this
.
$scope
});
}
...
...
@@ -184,13 +181,6 @@ export class PanelCtrl {
this
.
events
.
emit
(
'render'
,
payload
);
}
private
onSizeChanged
()
{
this
.
calculatePanelHeight
();
this
.
$timeout
(()
=>
{
this
.
render
();
},
100
);
}
duplicate
()
{
this
.
dashboard
.
duplicatePanel
(
this
.
panel
);
this
.
$timeout
(()
=>
{
...
...
public/app/features/panel/panel_directive.ts
View file @
55609382
...
...
@@ -53,7 +53,7 @@ var panelTemplate = `
</div>
`
;
module
.
directive
(
'grafanaPanel'
,
function
(
$rootScope
,
$document
)
{
module
.
directive
(
'grafanaPanel'
,
function
(
$rootScope
,
$document
,
$timeout
)
{
return
{
restrict
:
'E'
,
template
:
panelTemplate
,
...
...
@@ -106,11 +106,19 @@ module.directive('grafanaPanel', function($rootScope, $document) {
}
});
ctrl
.
events
.
on
(
'render'
,
()
=>
{
if
(
lastHeight
!==
ctrl
.
height
)
{
panelHeightUpdated
();
}
ctrl
.
events
.
on
(
'panel-size-changed'
,
()
=>
{
ctrl
.
calculatePanelHeight
();
panelHeightUpdated
();
$timeout
(()
=>
{
ctrl
.
render
();
});
});
// set initial height
ctrl
.
calculatePanelHeight
();
panelHeightUpdated
();
ctrl
.
events
.
on
(
'render'
,
()
=>
{
if
(
transparentLastState
!==
ctrl
.
panel
.
transparent
)
{
panelContainer
.
toggleClass
(
'panel-transparent'
,
ctrl
.
panel
.
transparent
===
true
);
transparentLastState
=
ctrl
.
panel
.
transparent
;
...
...
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