Skip to content

Commit

Permalink
added index property to cell
Browse files Browse the repository at this point in the history
  • Loading branch information
carlosmaranje committed May 10, 2024
1 parent 336e30e commit 3fc13c8
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/js/elements/Cell.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,18 @@ export default class Cell {
*/
parent;

/**
* @type number
*/
index;

/**
* @param cell {HTMLTableCellElement}
*/
constructor(cell) {
this.parent = cell.parentNode;
this.siblings = new Siblings(this.parent, 3);
this.index = Array.prototype.indexOf.call(this.parent.children, cell);
this.siblings = new Siblings(this.parent, this.index);
}
}

Expand Down

0 comments on commit 3fc13c8

Please sign in to comment.