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

Commit

Permalink
Recalculate dimensions on devtools toggle.
Browse files Browse the repository at this point in the history
  • Loading branch information
vlad-shatskyi committed May 31, 2016
1 parent c4f0330 commit a337895
Showing 1 changed file with 17 additions and 6 deletions.
23 changes: 17 additions & 6 deletions src/views/1_ApplicationComponent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,18 +30,23 @@ export default class ApplicationComponent extends React.Component<{}, State> {
.on("move", () => saveWindowBounds(focusedWindow))
.on("resize", () => {
saveWindowBounds(focusedWindow);

for (const tab of this.tabs) {
tab.updateAllSessionsDimensions();
}
});
this.recalculateDimensions();
})
.webContents
.on("devtools-opened", () => this.recalculateDimensions())
.on("devtools-closed", () => this.recalculateDimensions());

ipcRenderer.on("change-working-directory", (event: Electron.IpcRendererEvent, directory: string) =>
this.activeTab.activeSession().directory = directory
);

window.onbeforeunload = () => {
focusedWindow.removeAllListeners();
focusedWindow
.removeAllListeners()
.webContents
.removeAllListeners("devtools-opened")
.removeAllListeners("devtools-closed");

this.closeAllTabs();
}
}
Expand Down Expand Up @@ -162,6 +167,12 @@ export default class ApplicationComponent extends React.Component<{}, State> {
};
}

private recalculateDimensions() {
for (const tab of this.tabs) {
tab.updateAllSessionsDimensions();
}
}

public closeSession(sessionToClose: Session) {
for (const tab of this.tabs) {
for (const session of tab.sessions) {
Expand Down

0 comments on commit a337895

Please sign in to comment.