@@ -105,29 +105,29 @@ function removeColumnFromIndex (colIndex): void {
105105 var previousIndex = $ ( 'select[name="field_key[' + colIndex + ']"]' )
106106 . attr ( 'data-index' ) ;
107107 if ( previousIndex . length ) {
108- previousIndex = previousIndex . split ( ',' ) ;
109- var sourceArray = Indexes . getIndexArray ( previousIndex [ 0 ] ) ;
108+ const previousIndexes = previousIndex . split ( ',' ) ;
109+ var sourceArray = Indexes . getIndexArray ( previousIndexes [ 0 ] ) ;
110110 if ( sourceArray === null ) {
111111 return ;
112112 }
113113
114114 // Remove column from index array.
115- var sourceLength = sourceArray [ previousIndex [ 1 ] ] . columns . length ;
115+ var sourceLength = sourceArray [ previousIndexes [ 1 ] ] . columns . length ;
116116 for ( var i = 0 ; i < sourceLength ; i ++ ) {
117- if ( sourceArray [ previousIndex [ 1 ] ] . columns [ i ] . col_index === colIndex ) {
118- sourceArray [ previousIndex [ 1 ] ] . columns . splice ( i , 1 ) ;
117+ if ( sourceArray [ previousIndexes [ 1 ] ] . columns [ i ] . col_index === colIndex ) {
118+ sourceArray [ previousIndexes [ 1 ] ] . columns . splice ( i , 1 ) ;
119119 }
120120 }
121121
122122 // Remove index completely if no columns left.
123- if ( sourceArray [ previousIndex [ 1 ] ] . columns . length === 0 ) {
124- sourceArray . splice ( previousIndex [ 1 ] , 1 ) ;
123+ if ( sourceArray [ previousIndexes [ 1 ] ] . columns . length === 0 ) {
124+ sourceArray . splice ( previousIndexes [ 1 ] , 1 ) ;
125125 }
126126
127127 // Update current index details.
128128 $ ( 'select[name="field_key[' + colIndex + ']"]' ) . attr ( 'data-index' , '' ) ;
129129 // Update form index parameters.
130- Indexes . setIndexFormParameters ( sourceArray , previousIndex [ 0 ] . toLowerCase ( ) ) ;
130+ Indexes . setIndexFormParameters ( sourceArray , previousIndexes [ 0 ] . toLowerCase ( ) ) ;
131131 }
132132}
133133
0 commit comments