Skip to content

Commit e41199f

Browse files
gjmooneymartinRenou
authored andcommitted
Implement suggested changes
Signed-off-by: gjmooney <[email protected]>
1 parent 2daca5e commit e41199f

File tree

1 file changed

+7
-11
lines changed

1 file changed

+7
-11
lines changed

js/feathergrid.ts

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -871,15 +871,6 @@ export class FeatherGrid extends Widget {
871871
});
872872
}
873873

874-
_isSelectionSelected(): boolean {
875-
if (this.grid.selectionModel && !this.grid.selectionModel.isEmpty) {
876-
return true;
877-
} else {
878-
return false;
879-
}
880-
// return this.grid.selectionModel && this.grid.selectionModel.isEmpty;
881-
}
882-
883874
private _createCommandRegistry(): CommandRegistry {
884875
const commands = new CommandRegistry();
885876
commands.addCommand(FeatherGridContextMenu.CommandID.SortAscending, {
@@ -995,7 +986,10 @@ export class FeatherGrid extends Widget {
995986
label: 'Copy Selection to Clipboard',
996987
mnemonic: -1,
997988
isEnabled: () => {
998-
return this._isSelectionSelected();
989+
return (
990+
this.grid.selectionModel !== null &&
991+
!this.grid.selectionModel.isEmpty
992+
);
999993
},
1000994
execute: () => {
1001995
this.grid.copyToClipboard();
@@ -1006,7 +1000,9 @@ export class FeatherGrid extends Widget {
10061000
label: 'Download Selection as CSV',
10071001
mnemonic: -1,
10081002
isEnabled: () => {
1009-
return this._isSelectionSelected();
1003+
return (
1004+
this.grid.selectionModel !== null && !this.grid.selectionModel.isEmpty
1005+
);
10101006
},
10111007
execute: () => {
10121008
this.downloadAsCsv(true);

0 commit comments

Comments
 (0)