Skip to content
This repository has been archived by the owner on May 21, 2019. It is now read-only.

Commit

Permalink
Bind event handlers.
Browse files Browse the repository at this point in the history
  • Loading branch information
vlad-shatskyi committed Aug 12, 2015
1 parent 419a5cf commit 7b11841
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/views/TerminalComponent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,15 @@ export default class TerminalComponent extends React.Component<Props, State> {
}
handleKeyDown(event: React.KeyboardEvent) {
// Ctrl+L.
if (event.ctrlKey && event.keyCode === 76) {
if (event.ctrlKey && event.keyCode == 76) {
this.props.terminal.clearInvocations();

event.stopPropagation();
event.preventDefault();
}

// Cmd+D.
if (event.metaKey && event.keyCode === 68) {
if (event.metaKey && event.keyCode == 68) {
(<any>window).DEBUG = !(<any>window).DEBUG;

event.stopPropagation();
Expand All @@ -52,7 +52,7 @@ export default class TerminalComponent extends React.Component<Props, State> {
React.createElement(InvocationComponent, { key: invocation.id, invocation: invocation }, [])
);

return React.createElement( 'div', { className: 'terminal', onKeyDown: this.handleKeyDown },
return React.createElement( 'div', { className: 'terminal', onKeyDown: this.handleKeyDown.bind(this) },
React.createElement( 'div', { className: 'invocations' }, invocations ),
React.createElement(StatusLine, { currentWorkingDirectory: this.props.terminal.currentDirectory, vcsData: this.state.vcsData })
);
Expand Down
2 changes: 1 addition & 1 deletion src/views/TerminalLayout.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ export class TerminalLayout extends React.Component<{}, State> {
(terminal, index) => React.createElement(TerminalComponent, {"terminal": terminal, "key": index})
);

return React.createElement("div", {className: "terminal-layout", onKeyDown: this.handleKeyDown}, terminals)
return React.createElement("div", {className: "terminal-layout", onKeyDown: this.handleKeyDown.bind(this)}, terminals)
}

private getWindowDimensions() {
Expand Down

0 comments on commit 7b11841

Please sign in to comment.