@@ -263,6 +263,7 @@ define([
263
263
this . labelInfos [ layerId ] [ sublayer ] . selections ;
264
264
this . tabContainer . selectChild ( this . tabBasic ) ;
265
265
if ( hasSelections ) {
266
+ this . set ( 'hasLabels' , true ) ;
266
267
this . emptyStore ( this . labelSelectionStore ) ;
267
268
this . labelInfos [ layerId ] [ sublayer ] . selections . forEach ( lang . hitch ( this , function ( labelObj ) {
268
269
labelObj . id = '_' + count ++ ;
@@ -272,12 +273,15 @@ define([
272
273
this . labelSelect . set ( 'value' , '_' + 1 ) ;
273
274
this . labelTextbox . set ( 'value' , this . labelSelectionStore . get ( '_' + 1 ) . value ) ;
274
275
this . addSelectedLabels ( ) ;
275
- domClass . remove ( this . defaultLabelWrapper , 'dijitHidden' ) ;
276
276
} else {
277
- domClass . add ( this . defaultLabelWrapper , 'dijitHidden' ) ;
277
+ this . set ( 'hasLabels' , false ) ;
278
278
}
279
279
} ,
280
280
_setFields : function ( fields ) {
281
+ if ( ! fields . length ) {
282
+ return ;
283
+ }
284
+ this . set ( 'hasLabels' , true ) ;
281
285
282
286
fields . forEach ( lang . hitch ( this , function ( f ) {
283
287
this . labelSelectionStore . put ( {
@@ -287,6 +291,10 @@ define([
287
291
} ) ;
288
292
} ) ) ;
289
293
} ,
294
+ hasLabels : false ,
295
+ _setHasLabelsAttr : function ( labels ) {
296
+ domClass [ labels ? 'remove' : 'add' ] ( this . fieldSpinner , 'dijitHidden' ) ;
297
+ } ,
290
298
/**
291
299
* Display a field loading spinner
292
300
* set using `this.set('fieldsLoading', true)`
0 commit comments