File tree Expand file tree Collapse file tree 1 file changed +6
-8
lines changed
src/components/GeoPointEditor Expand file tree Collapse file tree 1 file changed +6
-8
lines changed Original file line number Diff line number Diff line change @@ -88,22 +88,20 @@ export default class GeoPointEditor extends React.Component {
88
88
var values = value . split ( "," ) ;
89
89
90
90
if ( values . length == 2 ) {
91
- values = values . map ( function ( val ) {
92
- return val . trim ( ) ;
93
- } ) ;
91
+ values = values . map ( val => val . trim ( ) ) ;
94
92
95
- if ( values [ 0 ] . length > 0 && validateNumeric ( values [ 0 ] ) ) {
93
+ if ( values [ 0 ] . length > 0 && validateNumeric ( values [ 0 ] ) ) {
96
94
97
- if ( values [ 1 ] . length <= 0 || ! validateNumeric ( values [ 1 ] ) ) {
98
- this . setState ( { [ " latitude" ] : values [ 0 ] } ) ;
95
+ if ( values [ 1 ] . length <= 0 || ! validateNumeric ( values [ 1 ] ) ) {
96
+ this . setState ( { latitude : values [ 0 ] } ) ;
99
97
this . refs . longitude . focus ( ) ;
100
98
this . refs . longitude . setSelectionRange ( 0 , String ( this . state . longitude ) . length ) ;
101
99
return ;
102
100
}
103
101
104
102
if ( validateNumeric ( values [ 1 ] ) ) {
105
- this . setState ( { [ " latitude" ] : values [ 0 ] } ) ;
106
- this . setState ( { [ " longitude" ] : values [ 1 ] } ) ;
103
+ this . setState ( { latitude : values [ 0 ] } ) ;
104
+ this . setState ( { longitude : values [ 1 ] } ) ;
107
105
this . refs . longitude . focus ( ) ;
108
106
return ;
109
107
}
You can’t perform that action at this time.
0 commit comments