@@ -15,7 +15,7 @@ import { Panel } from '@lumino/widgets';
15
15
import * as React from 'react' ;
16
16
import { v4 as uuid } from 'uuid' ;
17
17
18
- import { focusInputField , removeStyleFromProperty , deepCopy } from '../tools' ;
18
+ import { deepCopy } from '../tools' ;
19
19
import { IControlPanelModel } from '../types' ;
20
20
import { LayerPropertiesForm , RasterSourcePropertiesForm } from './formbuilder' ;
21
21
import { JupyterGISWidget } from '../widget' ;
@@ -112,23 +112,6 @@ class ObjectPropertiesReact extends React.Component<IProps, IStates> {
112
112
model . sharedModel . updateObjectParameters ( id , properties ) ;
113
113
}
114
114
115
- syncSelectedField = (
116
- id : string | null ,
117
- value : any ,
118
- parentType : 'panel' | 'dialog'
119
- ) => {
120
- let property : string | null = null ;
121
- if ( id ) {
122
- const prefix = id . split ( '_' ) [ 0 ] ;
123
- property = id . substring ( prefix . length ) ;
124
- }
125
- this . props . cpModel . jGISModel ?. syncSelectedPropField ( {
126
- parentType,
127
- id : property ,
128
- value
129
- } ) ;
130
- } ;
131
-
132
115
private _sharedJGISModelChanged = (
133
116
_ : IJupyterGISDoc ,
134
117
changed : IJGISLayerDocChange
@@ -140,43 +123,17 @@ class ObjectPropertiesReact extends React.Component<IProps, IStates> {
140
123
sender : IJupyterGISModel ,
141
124
clients : Map < number , IJupyterGISClientState >
142
125
) : void => {
143
- const remoteUser = this . props . cpModel . jGISModel ?. localState ?. remoteUser ;
144
126
let newState : IJupyterGISClientState | undefined ;
145
127
const clientId = this . state . clientId ;
146
- if ( remoteUser ) {
147
- newState = clients . get ( remoteUser ) ;
148
-
149
- const id = newState ?. selectedPropField ?. id ;
150
- const value = newState ?. selectedPropField ?. value ;
151
- const parentType = newState ?. selectedPropField ?. parentType ;
152
- if ( parentType === 'panel' ) {
153
- this . _lastSelectedPropFieldId = focusInputField (
154
- `${ this . state . filePath } ::panel` ,
155
- id ,
156
- value ,
157
- newState ?. user ?. color ,
158
- this . _lastSelectedPropFieldId
159
- ) ;
160
- }
161
- } else {
162
- const localState = clientId ? clients . get ( clientId ) : null ;
163
- if ( this . _lastSelectedPropFieldId ) {
164
- removeStyleFromProperty (
165
- `${ this . state . filePath } ::panel` ,
166
- this . _lastSelectedPropFieldId ,
167
- [ 'border-color' , 'box-shadow' ]
168
- ) ;
169
128
170
- this . _lastSelectedPropFieldId = undefined ;
171
- }
172
- if (
173
- localState &&
174
- localState . selected ?. emitter &&
175
- localState . selected . emitter !== this . state . id &&
176
- localState . selected ?. value
177
- ) {
178
- newState = localState ;
179
- }
129
+ const localState = clientId ? clients . get ( clientId ) : null ;
130
+ if (
131
+ localState &&
132
+ localState . selected ?. emitter &&
133
+ localState . selected . emitter !== this . state . id &&
134
+ localState . selected ?. value
135
+ ) {
136
+ newState = localState ;
180
137
}
181
138
if ( newState ) {
182
139
const selection = newState . selected . value ;
@@ -250,7 +207,6 @@ class ObjectPropertiesReact extends React.Component<IProps, IStates> {
250
207
< div >
251
208
< h3 > Source Properties</ h3 >
252
209
< RasterSourcePropertiesForm
253
- parentType = "panel"
254
210
model = { model }
255
211
filePath = { `${ this . state . filePath } ::panel` }
256
212
schema = { schema }
@@ -261,7 +217,6 @@ class ObjectPropertiesReact extends React.Component<IProps, IStates> {
261
217
properties
262
218
) ;
263
219
} }
264
- syncSelectedField = { this . syncSelectedField }
265
220
/>
266
221
</ div >
267
222
)
@@ -276,7 +231,6 @@ class ObjectPropertiesReact extends React.Component<IProps, IStates> {
276
231
< div >
277
232
< h3 > Layer Properties</ h3 >
278
233
< LayerPropertiesForm
279
- parentType = "panel"
280
234
sourceType = { selectedObjSource . type }
281
235
model = { model }
282
236
filePath = { `${ this . state . filePath } ::panel` }
@@ -285,20 +239,17 @@ class ObjectPropertiesReact extends React.Component<IProps, IStates> {
285
239
syncData = { ( properties : { [ key : string ] : any } ) => {
286
240
this . syncObjectProperties ( this . state . selectedObject , properties ) ;
287
241
} }
288
- syncSelectedField = { this . syncSelectedField }
289
242
/>
290
243
< h3 > Source Properties</ h3 >
291
244
{ selectedObjSource . type === 'RasterSource' && (
292
245
< RasterSourcePropertiesForm
293
- parentType = "panel"
294
246
model = { model }
295
247
filePath = { `${ this . state . filePath } ::panel` }
296
248
schema = { sourceSchema }
297
249
sourceData = { selectedObjectSourceData }
298
250
syncData = { ( properties : { [ key : string ] : any } ) => {
299
251
this . syncObjectProperties ( selectedObjectSourceId , properties ) ;
300
252
} }
301
- syncSelectedField = { this . syncSelectedField }
302
253
/>
303
254
) }
304
255
{ /* {selectedObjSource.type === 'GeoJSONSource' && (
@@ -309,7 +260,6 @@ class ObjectPropertiesReact extends React.Component<IProps, IStates> {
309
260
) ;
310
261
}
311
262
312
- private _lastSelectedPropFieldId ?: string ;
313
263
private _formSchema : Map < string , IDict > ;
314
264
}
315
265
0 commit comments