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
a1b20c8c
Unverified
Commit
a1b20c8c
authored
Mar 11, 2019
by
Torkel Ödegaard
Committed by
GitHub
Mar 11, 2019
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #15918 from ryantxu/handle-to-on
rename handleXXX to onXX events
parents
aa7e3486
59b5f887
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
11 additions
and
11 deletions
+11
-11
packages/grafana-ui/src/components/ColorPicker/ColorInput.tsx
+3
-3
packages/grafana-ui/src/components/ColorPicker/ColorPicker.tsx
+2
-2
packages/grafana-ui/src/components/ColorPicker/ColorPickerPopover.tsx
+4
-4
public/app/core/components/ToggleButtonGroup/ToggleButtonGroup.tsx
+2
-2
No files found.
packages/grafana-ui/src/components/ColorPicker/ColorInput.tsx
View file @
a1b20c8c
...
...
@@ -39,7 +39,7 @@ class ColorInput extends React.PureComponent<ColorInputProps, ColorInputState> {
this
.
props
.
onChange
(
color
);
};
handle
Change
=
(
event
:
React
.
SyntheticEvent
<
HTMLInputElement
>
)
=>
{
on
Change
=
(
event
:
React
.
SyntheticEvent
<
HTMLInputElement
>
)
=>
{
const
newColor
=
tinycolor
(
event
.
currentTarget
.
value
);
this
.
setState
({
...
...
@@ -51,7 +51,7 @@ class ColorInput extends React.PureComponent<ColorInputProps, ColorInputState> {
}
};
handle
Blur
=
()
=>
{
on
Blur
=
()
=>
{
const
newColor
=
tinycolor
(
this
.
state
.
value
);
if
(
!
newColor
.
isValid
())
{
...
...
@@ -84,7 +84,7 @@ class ColorInput extends React.PureComponent<ColorInputProps, ColorInputState> {
flexGrow
:
1
,
}
}
>
<
input
className=
"gf-form-input"
value=
{
value
}
onChange=
{
this
.
handleChange
}
onBlur=
{
this
.
handle
Blur
}
/>
<
input
className=
"gf-form-input"
value=
{
value
}
onChange=
{
this
.
onChange
}
onBlur=
{
this
.
on
Blur
}
/>
</
div
>
</
div
>
);
...
...
packages/grafana-ui/src/components/ColorPicker/ColorPicker.tsx
View file @
a1b20c8c
...
...
@@ -15,7 +15,7 @@ export const colorPickerFactory = <T extends ColorPickerProps>(
static
displayName
=
displayName
;
pickerTriggerRef
=
createRef
<
HTMLDivElement
>
();
handle
ColorChange
=
(
color
:
string
)
=>
{
on
ColorChange
=
(
color
:
string
)
=>
{
const
{
onColorChange
,
onChange
}
=
this
.
props
;
const
changeHandler
=
(
onColorChange
||
onChange
)
as
ColorPickerChangeHandler
;
...
...
@@ -25,7 +25,7 @@ export const colorPickerFactory = <T extends ColorPickerProps>(
render
()
{
const
popoverElement
=
React
.
createElement
(
popover
,
{
...
this
.
props
,
onChange
:
this
.
handle
ColorChange
,
onChange
:
this
.
on
ColorChange
,
});
const
{
theme
,
children
}
=
this
.
props
;
...
...
packages/grafana-ui/src/components/ColorPicker/ColorPickerPopover.tsx
View file @
a1b20c8c
...
...
@@ -60,7 +60,7 @@ export class ColorPickerPopover<T extends CustomPickersDescriptor> extends React
changeHandler
(
getColorFromHexRgbOrName
(
color
,
theme
.
type
));
};
handle
TabChange
=
(
tab
:
PickerType
|
keyof
T
)
=>
{
on
TabChange
=
(
tab
:
PickerType
|
keyof
T
)
=>
{
return
()
=>
this
.
setState
({
activePicker
:
tab
});
};
...
...
@@ -104,7 +104,7 @@ export class ColorPickerPopover<T extends CustomPickersDescriptor> extends React
<>
{
Object
.
keys
(
customPickers
).
map
(
key
=>
{
return
(
<
div
className=
{
this
.
getTabClassName
(
key
)
}
onClick=
{
this
.
handle
TabChange
(
key
)
}
key=
{
key
}
>
<
div
className=
{
this
.
getTabClassName
(
key
)
}
onClick=
{
this
.
on
TabChange
(
key
)
}
key=
{
key
}
>
{
customPickers
[
key
].
name
}
</
div
>
);
...
...
@@ -119,10 +119,10 @@ export class ColorPickerPopover<T extends CustomPickersDescriptor> extends React
return
(
<
div
className=
{
`ColorPickerPopover ColorPickerPopover--${colorPickerTheme}`
}
>
<
div
className=
"ColorPickerPopover__tabs"
>
<
div
className=
{
this
.
getTabClassName
(
'palette'
)
}
onClick=
{
this
.
handle
TabChange
(
'palette'
)
}
>
<
div
className=
{
this
.
getTabClassName
(
'palette'
)
}
onClick=
{
this
.
on
TabChange
(
'palette'
)
}
>
Colors
</
div
>
<
div
className=
{
this
.
getTabClassName
(
'spectrum'
)
}
onClick=
{
this
.
handle
TabChange
(
'spectrum'
)
}
>
<
div
className=
{
this
.
getTabClassName
(
'spectrum'
)
}
onClick=
{
this
.
on
TabChange
(
'spectrum'
)
}
>
Custom
</
div
>
{
this
.
renderCustomPickerTabs
()
}
...
...
public/app/core/components/ToggleButtonGroup/ToggleButtonGroup.tsx
View file @
a1b20c8c
...
...
@@ -37,7 +37,7 @@ export const ToggleButton: FC<ToggleButtonProps> = ({
tooltip
,
onChange
,
})
=>
{
const
handleChange
=
event
=>
{
const
onClick
=
event
=>
{
event
.
stopPropagation
();
if
(
onChange
)
{
onChange
(
value
);
...
...
@@ -46,7 +46,7 @@ export const ToggleButton: FC<ToggleButtonProps> = ({
const
btnClassName
=
`btn
${
className
}
${
selected
?
'active'
:
''
}
`
;
const
button
=
(
<
button
className=
{
btnClassName
}
onClick=
{
handleChange
}
>
<
button
className=
{
btnClassName
}
onClick=
{
onClick
}
>
<
span
>
{
children
}
</
span
>
</
button
>
);
...
...
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