@@ -209,7 +209,7 @@ export class TableAuthoring extends ComponentAuthoring {
209209 } ;
210210 }
211211
212- insertRow ( y : number ) : void {
212+ insertRow ( rowIndex : number ) : void {
213213 const tableData = this . authoringComponentContent . tableData ;
214214 const newRow = [ ] ;
215215 const numColumns = this . authoringComponentContent . numColumns ;
@@ -221,46 +221,42 @@ export class TableAuthoring extends ComponentAuthoring {
221221 }
222222 newRow . push ( newCell ) ;
223223 }
224- tableData . splice ( y , 0 , newRow ) ;
224+ tableData . splice ( rowIndex , 0 , newRow ) ;
225225 this . authoringComponentContent . numRows ++ ;
226226 this . componentChanged ( ) ;
227227 }
228228
229- deleteRow ( y : number ) : void {
229+ deleteRow ( rowIndex : number ) : void {
230230 if ( confirm ( $localize `Are you sure you want to delete this row?` ) ) {
231231 const tableData = this . authoringComponentContent . tableData ;
232232 if ( tableData != null ) {
233- tableData . splice ( y , 1 ) ;
233+ tableData . splice ( rowIndex , 1 ) ;
234234 this . authoringComponentContent . numRows -- ;
235235 }
236236 this . componentChanged ( ) ;
237237 }
238238 }
239239
240- insertColumn ( x : number ) : void {
240+ insertColumn ( columnIndex : number ) : void {
241241 const tableData = this . authoringComponentContent . tableData ;
242242 const numRows = this . authoringComponentContent . numRows ;
243243 for ( let r = 0 ; r < numRows ; r ++ ) {
244- const tempRow = tableData [ r ] ;
245- if ( tempRow != null ) {
246- const newCell = this . createEmptyCell ( ) ;
247- tempRow . splice ( x , 0 , newCell ) ;
248- }
244+ const row = tableData [ r ] ;
245+ const newCell = this . createEmptyCell ( ) ;
246+ row . splice ( columnIndex , 0 , newCell ) ;
249247 }
250248 this . authoringComponentContent . numColumns ++ ;
251249 this . parseColumnCellSizes ( this . authoringComponentContent ) ;
252250 this . componentChanged ( ) ;
253251 }
254252
255- deleteColumn ( x : number ) : void {
253+ deleteColumn ( columnIndex : number ) : void {
256254 if ( confirm ( $localize `Are you sure you want to delete this column?` ) ) {
257255 const tableData = this . authoringComponentContent . tableData ;
258256 const numRows = this . authoringComponentContent . numRows ;
259257 for ( let r = 0 ; r < numRows ; r ++ ) {
260- const tempRow = tableData [ r ] ;
261- if ( tempRow != null ) {
262- tempRow . splice ( x , 1 ) ;
263- }
258+ const row = tableData [ r ] ;
259+ row . splice ( columnIndex , 1 ) ;
264260 }
265261 this . authoringComponentContent . numColumns -- ;
266262 this . parseColumnCellSizes ( this . authoringComponentContent ) ;
0 commit comments