Skip to content

Commit

Permalink
define events as hash instead of method
Browse files Browse the repository at this point in the history
  • Loading branch information
chrishavlin committed Sep 19, 2024
1 parent 012082f commit cc00c5f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
8 changes: 8 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -110,3 +110,11 @@ dmypy.json

# OSX files
.DS_Store

# pycharm
.idea/

# yarn build related
.yarn/
.yarnrc.yml
yarn.lock
6 changes: 1 addition & 5 deletions src/fullscreen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,11 +89,7 @@ export class FullscreenButtonView extends DOMWidgetView {
/**
* Dictionary of events and handlers
*/
events(): { [e: string]: string } {
// TODO: return typing not needed in Typescript later than 1.8.x
// See http://stackoverflow.com/questions/22077023/why-cant-i-indirectly-return-an-object-literal-to-satisfy-an-index-signature-re and https://github.com/Microsoft/TypeScript/pull/7029
return { click: '_handle_click' };
}
events: { [e: string]: string } = { click: '_handle_click' };

/**
* Handles when the button is clicked.
Expand Down

0 comments on commit cc00c5f

Please sign in to comment.