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
77b537f4
Commit
77b537f4
authored
Dec 08, 2017
by
Torkel Ödegaard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ux: added react scrollbar component and added it to add panel panel
parent
2bc23d20
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
67 additions
and
3 deletions
+67
-3
public/app/core/components/ScrollBar/ScrollBar.tsx
+62
-0
public/app/features/dashboard/dashboard_ctrl.ts
+0
-1
public/app/features/dashboard/dashgrid/AddPanelPanel.tsx
+3
-2
public/app/features/panel/panel_header.ts
+1
-0
public/sass/components/_panel_add_panel.scss
+1
-0
No files found.
public/app/core/components/ScrollBar/ScrollBar.tsx
0 → 100644
View file @
77b537f4
import
React
from
'react'
;
import
PerfectScrollbar
from
'perfect-scrollbar'
;
export
interface
Props
{
children
:
any
;
className
:
string
;
}
export
default
class
ScrollBar
extends
React
.
Component
<
Props
,
any
>
{
private
container
:
any
;
private
ps
:
PerfectScrollbar
;
constructor
(
props
)
{
super
(
props
);
}
componentDidMount
()
{
this
.
ps
=
new
PerfectScrollbar
(
this
.
container
);
}
componentDidUpdate
()
{
this
.
ps
.
update
();
}
componentWillUnmount
()
{
this
.
ps
.
destroy
();
}
// methods can be invoked by outside
setScrollTop
(
top
)
{
if
(
this
.
container
)
{
this
.
container
.
scrollTop
=
top
;
this
.
ps
.
update
();
return
true
;
}
return
false
;
}
setScrollLeft
(
left
)
{
if
(
this
.
container
)
{
this
.
container
.
scrollLeft
=
left
;
this
.
ps
.
update
();
return
true
;
}
return
false
;
}
handleRef
=
ref
=>
{
this
.
container
=
ref
;
};
render
()
{
return
(
<
div
className=
{
this
.
props
.
className
}
ref=
{
this
.
handleRef
}
>
{
this
.
props
.
children
}
</
div
>
);
}
}
public/app/features/dashboard/dashboard_ctrl.ts
View file @
77b537f4
...
@@ -129,7 +129,6 @@ export class DashboardCtrl implements PanelContainer {
...
@@ -129,7 +129,6 @@ export class DashboardCtrl implements PanelContainer {
}
}
getPanelContainer
()
{
getPanelContainer
()
{
console
.
log
(
'DashboardCtrl:getPanelContainer()'
);
return
this
;
return
this
;
}
}
...
...
public/app/features/dashboard/dashgrid/AddPanelPanel.tsx
View file @
77b537f4
...
@@ -4,6 +4,7 @@ import _ from 'lodash';
...
@@ -4,6 +4,7 @@ import _ from 'lodash';
import
config
from
'app/core/config'
;
import
config
from
'app/core/config'
;
import
{
PanelModel
}
from
'../panel_model'
;
import
{
PanelModel
}
from
'../panel_model'
;
import
{
PanelContainer
}
from
'./PanelContainer'
;
import
{
PanelContainer
}
from
'./PanelContainer'
;
import
ScrollBar
from
'app/core/components/ScrollBar/ScrollBar'
;
export
interface
AddPanelPanelProps
{
export
interface
AddPanelPanelProps
{
panel
:
PanelModel
;
panel
:
PanelModel
;
...
@@ -78,9 +79,9 @@ export class AddPanelPanel extends React.Component<AddPanelPanelProps, AddPanelP
...
@@ -78,9 +79,9 @@ export class AddPanelPanel extends React.Component<AddPanelPanelProps, AddPanelP
<
span
className=
"add-panel__title"
>
New Panel
</
span
>
<
span
className=
"add-panel__title"
>
New Panel
</
span
>
<
span
className=
"add-panel__sub-title"
>
Select a visualization
</
span
>
<
span
className=
"add-panel__sub-title"
>
Select a visualization
</
span
>
</
div
>
</
div
>
<
div
className=
"add-panel__items"
>
<
ScrollBar
className=
"add-panel__items"
>
{
this
.
state
.
panelPlugins
.
map
(
this
.
renderPanelItem
.
bind
(
this
))
}
{
this
.
state
.
panelPlugins
.
map
(
this
.
renderPanelItem
.
bind
(
this
))
}
</
div
>
</
ScrollBar
>
</
div
>
</
div
>
</
div
>
</
div
>
);
);
...
...
public/app/features/panel/panel_header.ts
View file @
77b537f4
...
@@ -84,6 +84,7 @@ function panelHeader($compile) {
...
@@ -84,6 +84,7 @@ function panelHeader($compile) {
restrict
:
'E'
,
restrict
:
'E'
,
template
:
template
,
template
:
template
,
link
:
function
(
scope
,
elem
,
attrs
)
{
link
:
function
(
scope
,
elem
,
attrs
)
{
console
.
log
(
elem
.
html
());
let
menuElem
=
elem
.
find
(
'.panel-menu'
);
let
menuElem
=
elem
.
find
(
'.panel-menu'
);
let
menuScope
;
let
menuScope
;
...
...
public/sass/components/_panel_add_panel.scss
View file @
77b537f4
...
@@ -35,6 +35,7 @@
...
@@ -35,6 +35,7 @@
height
:
calc
(
100%
-
43px
);
height
:
calc
(
100%
-
43px
);
align-content
:
flex-start
;
align-content
:
flex-start
;
justify-content
:
space-around
;
justify-content
:
space-around
;
position
:
relative
;
}
}
.add-panel__item
{
.add-panel__item
{
...
...
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