Skip to content

Commit

Permalink
refactor: remove uneccessary condition
Browse files Browse the repository at this point in the history
  • Loading branch information
sokumon committed Feb 6, 2025
1 parent 0c7adb9 commit 6ba6369
Showing 1 changed file with 10 additions and 13 deletions.
23 changes: 10 additions & 13 deletions src/cellmanager.js
Original file line number Diff line number Diff line change
Expand Up @@ -561,21 +561,18 @@ export default class CellManager {
// copy only focusedCell
const {
colIndex,
rowIndex
rowIndex,
isTotalRow
} = $.data($cell1);
if (rowIndex === undefined) {
// this must be a footer
const {isTotalRow} = $.data($cell1);
if (isTotalRow) {
let choosenFooterCell = $('.dt-row-totalRow > .dt-cell--focus');
let content = choosenFooterCell.children[0].title;
copyTextToClipboard(content);
return 1;
}
let copiedContent = ""
if (isTotalRow) {
let choosenFooterCell = this.$focusedCell;
copiedContent = choosenFooterCell.children[0].title;
}else{
const cell = this.getCell(colIndex, rowIndex);
copiedContent = cell.content
}
const cell = this.getCell(colIndex, rowIndex);

copyTextToClipboard(cell.content);
copyTextToClipboard(copiedContent);
return 1;
}
const cells = this.getCellsInRange($cell1, $cell2);
Expand Down

0 comments on commit 6ba6369

Please sign in to comment.