Skip to content

Commit

Permalink
fix(code/frontend): main page (#29811)
Browse files Browse the repository at this point in the history
  • Loading branch information
WangQianliang authored Feb 20, 2019
1 parent 7db0996 commit 300783c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
14 changes: 8 additions & 6 deletions x-pack/plugins/code/public/components/editor/editor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,11 @@ export class EditorComponent extends React.Component<IProps> {
if (this.props.revealPosition) {
this.revealPosition(this.props.revealPosition);
}
if (this.props.showBlame) {
this.loadBlame(this.props.blames);
}
});
}
if (this.props.showBlame) {
this.loadBlame(this.props.blames);
}
}

public componentWillReceiveProps(nextProps: Props) {
Expand Down Expand Up @@ -111,9 +111,8 @@ export class EditorComponent extends React.Component<IProps> {
macModifier={[Modifier.meta]}
winModifier={[Modifier.ctrl]}
/>
<EuiFlexItem
<div
tabIndex={0}
grow={1}
className="code-editor-container"
id="mainEditor"
style={{ paddingLeft: this.props.showBlame ? 300 : 0 }}
Expand All @@ -124,8 +123,11 @@ export class EditorComponent extends React.Component<IProps> {
}

public loadBlame(blames: GitBlame[]) {
if (this.blameWidgets) {
this.destroyBlameWidgets();
}
this.blameWidgets = blames.map((b, index) => {
return new BlameWidget(b, index === 0, this.editor!);
return new BlameWidget(b, index === 0, this.monaco!.editor!);
});
}

Expand Down
2 changes: 2 additions & 0 deletions x-pack/plugins/code/public/components/main/side_tabs.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ const Container = styled.div`
width: calc(256rem / 14);
border-right: ${theme.euiBorderThin};
display: flex;
flex-grow: 0;
flex-shrink: 0;
flex-direction: column;
& > div {
height: 100%;
Expand Down

0 comments on commit 300783c

Please sign in to comment.