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
18308bf5
Unverified
Commit
18308bf5
authored
Nov 14, 2018
by
Torkel Ödegaard
Committed by
GitHub
Nov 14, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #14069 from grafana/panel-focus-in-react
Panel focus in react
parents
3ce7197c
888eb9d9
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
15 deletions
+17
-15
public/app/features/dashboard/dashgrid/DashboardPanel.tsx
+17
-2
public/app/features/panel/panel_directive.ts
+0
-13
No files found.
public/app/features/dashboard/dashgrid/DashboardPanel.tsx
View file @
18308bf5
...
...
@@ -117,6 +117,14 @@ export class DashboardPanel extends PureComponent<Props, State> {
this
.
cleanUpAngularPanel
();
}
onMouseEnter
=
()
=>
{
this
.
props
.
dashboard
.
setPanelFocus
(
this
.
props
.
panel
.
id
);
};
onMouseLeave
=
()
=>
{
this
.
props
.
dashboard
.
setPanelFocus
(
0
);
};
renderReactPanel
()
{
const
{
dashboard
,
panel
}
=
this
.
props
;
const
{
plugin
}
=
this
.
state
;
...
...
@@ -127,7 +135,7 @@ export class DashboardPanel extends PureComponent<Props, State> {
// I want to try to keep markup (parents) for panel the same in edit mode to avoide unmount / new mount of panel
return
(
<
div
className=
{
containerClass
}
>
<
div
className=
{
panelWrapperClass
}
>
<
div
className=
{
panelWrapperClass
}
onMouseEnter=
{
this
.
onMouseEnter
}
onMouseLeave=
{
this
.
onMouseLeave
}
>
<
PanelChrome
component=
{
plugin
.
exports
.
Panel
}
panel=
{
panel
}
dashboard=
{
dashboard
}
/>
</
div
>
{
panel
.
isEditing
&&
(
...
...
@@ -156,6 +164,13 @@ export class DashboardPanel extends PureComponent<Props, State> {
}
// legacy angular rendering
return
<
div
ref=
{
element
=>
(
this
.
element
=
element
)
}
className=
"panel-height-helper"
/>;
return
(
<
div
ref=
{
element
=>
(
this
.
element
=
element
)
}
className=
"panel-height-helper"
onMouseEnter=
{
this
.
onMouseEnter
}
onMouseLeave=
{
this
.
onMouseLeave
}
/>
);
}
}
public/app/features/panel/panel_directive.ts
View file @
18308bf5
...
...
@@ -80,16 +80,6 @@ module.directive('grafanaPanel', ($rootScope, $document, $timeout) => {
let
lastAlertState
;
let
hasAlertRule
;
function
mouseEnter
()
{
panelContainer
.
toggleClass
(
'panel-hover-highlight'
,
true
);
ctrl
.
dashboard
.
setPanelFocus
(
ctrl
.
panel
.
id
);
}
function
mouseLeave
()
{
panelContainer
.
toggleClass
(
'panel-hover-highlight'
,
false
);
ctrl
.
dashboard
.
setPanelFocus
(
0
);
}
function
resizeScrollableContent
()
{
if
(
panelScrollbar
)
{
panelScrollbar
.
update
();
...
...
@@ -212,9 +202,6 @@ module.directive('grafanaPanel', ($rootScope, $document, $timeout) => {
scope
.
$apply
(
ctrl
.
openInspector
.
bind
(
ctrl
));
});
elem
.
on
(
'mouseenter'
,
mouseEnter
);
elem
.
on
(
'mouseleave'
,
mouseLeave
);
scope
.
$on
(
'$destroy'
,
()
=>
{
elem
.
off
();
cornerInfoElem
.
off
();
...
...
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