Skip to content

Commit

Permalink
fix: app column layout
Browse files Browse the repository at this point in the history
  • Loading branch information
moughxyz committed Jan 31, 2022
1 parent ebd8848 commit ed729ab
Show file tree
Hide file tree
Showing 7 changed files with 22 additions and 23 deletions.
2 changes: 1 addition & 1 deletion app/assets/javascripts/components/NoteGroupView.tsx
Expand Up @@ -40,7 +40,7 @@ export class NoteGroupView extends PureComponent<Props, State> {

render() {
return (
<div id="note-group-view" className="h-full app-column app-column-third">
<div id="editor-column" className="h-full app-column app-column-third">
{this.state.showMultipleSelectedNotes && (
<MultipleSelectedNotes
application={this.application}
Expand Down
24 changes: 11 additions & 13 deletions app/assets/javascripts/components/NoteView/NoteView.tsx
Expand Up @@ -1148,19 +1148,17 @@ export class NoteView extends PureComponent<Props, State> {
>
{this.state.marginResizersEnabled &&
this.editorContentRef.current ? (
<div className="left">
<PanelResizer
minWidth={300}
hoverable={true}
collapsable={false}
panel={this.editorContentRef.current}
side={PanelSide.Left}
type={PanelResizeType.OffsetAndWidth}
left={this.state.leftResizerOffset}
width={this.state.leftResizerWidth}
resizeFinishCallback={this.onPanelResizeFinish}
/>
</div>
<PanelResizer
minWidth={300}
hoverable={true}
collapsable={false}
panel={this.editorContentRef.current}
side={PanelSide.Left}
type={PanelResizeType.OffsetAndWidth}
left={this.state.leftResizerOffset}
width={this.state.leftResizerWidth}
resizeFinishCallback={this.onPanelResizeFinish}
/>
) : null}

{this.state.editorComponentViewer && (
Expand Down
2 changes: 1 addition & 1 deletion app/assets/javascripts/components/PanelResizer.tsx
Expand Up @@ -71,7 +71,7 @@ export class PanelResizer extends Component<Props, State> {
document.addEventListener('mouseup', this.onMouseUp);
document.addEventListener('mousemove', this.onMouseMove);
this.debouncedResizeHandler = debounce(this.handleResize, 250);
if (this.props.side === PanelSide.Right) {
if (this.props.type === PanelResizeType.OffsetAndWidth) {
window.addEventListener('resize', this.debouncedResizeHandler);
}
}
Expand Down
11 changes: 7 additions & 4 deletions app/assets/stylesheets/_columns.scss
Expand Up @@ -5,16 +5,19 @@

.app-column-first {
width: 180px;
flex-grow: 0;
flex-shrink: 0.2;
}

.app-column-second {
width: 350px;
flex-grow: 0;
flex-shrink: 0.5;
}

.app-column-third {
flex: 1 50%;
flex-grow: 1;
flex-shrink: 0.3;
}

.app-column {}
.app-column {
overflow: hidden;
}
2 changes: 0 additions & 2 deletions app/assets/stylesheets/_editor.scss
Expand Up @@ -7,7 +7,6 @@ $heading-height: 75px;
}

.section.editor {
flex: 1 50%;
display: flex;
flex-direction: column;
overflow-y: hidden;
Expand Down Expand Up @@ -39,7 +38,6 @@ $heading-height: 75px;
z-index: $z-index-editor-title-bar;

height: auto;
overflow: visible;

.title {
font-size: var(--sn-stylekit-font-size-h1);
Expand Down
3 changes: 2 additions & 1 deletion app/assets/stylesheets/_main.scss
Expand Up @@ -132,7 +132,8 @@ $footer-height: 2rem;
height: calc(100% - #{$footer-height});
width: 100%;
vertical-align: top;
overflow: hidden;
overflow-x: scroll;
overflow-y: hidden;
position: relative;

panel-resizer, .panel-resizer {
Expand Down
1 change: 0 additions & 1 deletion app/assets/stylesheets/_notes.scss
Expand Up @@ -5,7 +5,6 @@
border-left: 1px solid var(--sn-stylekit-border-color);
border-right: 1px solid var(--sn-stylekit-border-color);
font-size: var(--sn-stylekit-font-size-h2);
overflow: visible;
user-select: none;

-moz-user-select: none;
Expand Down

0 comments on commit ed729ab

Please sign in to comment.