File tree 1 file changed +14
-8
lines changed
1 file changed +14
-8
lines changed Original file line number Diff line number Diff line change @@ -274,10 +274,8 @@ sidebar.EditAttributesView = class {
274
274
return ( au < bu ) ? - 1 : ( au > bu ) ? 1 : 0 ;
275
275
} ) ;
276
276
this . _addHeader ( 'Attributes' ) ;
277
- let index = 0 ;
278
- for ( const attribute of sortedAttributes ) {
279
- this . _addAttribute ( attribute . name , attribute , index ) ;
280
- index ++ ;
277
+ for ( let idx = 0 ; idx < sortedAttributes . length ; idx ++ ) {
278
+ this . _addAttribute ( sortedAttributes [ idx ] . name , sortedAttributes [ idx ] , idx ) ;
281
279
}
282
280
if ( isCustom === true ) {
283
281
const addAttribute = this . _host . document . createElement ( 'div' ) ;
@@ -321,10 +319,18 @@ sidebar.EditAttributesView = class {
321
319
this . _editObject . _attribute [ key . name ] = key . value ;
322
320
this . _editObject . _attribute [ key . name + '_type' ] = key . type ;
323
321
}
324
- keys . push ( 'attribute' ) ;
325
- this . _editObject . _attribute [ 'attribute' ] = 'value' ;
326
- this . _editObject . _attribute [ 'attribute_type' ] = 'string' ;
327
- this . _editObject . _attribute . keys = keys ;
322
+
323
+ for ( let i = 1 ; true ; i ++ ) {
324
+ if ( ! keys . includes ( 'NewAttribute' + i . toString ( ) ) ) {
325
+ const key = 'NewAttribute' + i . toString ( ) ;
326
+ keys . push ( key ) ;
327
+
328
+ this . _editObject . _attribute [ key ] = 'Write a new value for this attribute' ;
329
+ this . _editObject . _attribute [ key + '_type' ] = 'string' ;
330
+ this . _editObject . _attribute . keys = keys ;
331
+ break ;
332
+ }
333
+ }
328
334
329
335
vscode . postMessage ( {
330
336
command : 'edit' ,
You can’t perform that action at this time.
0 commit comments