Hide page link icon when no page; make markdown edit rwork better on small width
Some checks failed
continuous-integration/drone/push Build is failing

This commit is contained in:
Garrett Mills 2020-11-16 09:47:06 -06:00
parent 7cb5745dc4
commit 2510fc0d68
Signed by: garrettmills
GPG Key ID: D2BF5FBA8298F246
3 changed files with 12 additions and 3 deletions

View File

@ -6,7 +6,7 @@ import {NavigationService} from '../../../../service/navigation.service';
@Component({
selector: 'editor-page-link-renderer',
template: `
<div title="Control-click to open this page" (click)="onClick($event)">
<div title="Control-click to open this page" (click)="onClick($event)" *ngIf="pageId">
<i class="fa fa-sticky-note" style="margin-right: 5px; color: var(--noded-background-note);"></i> {{ pageTitle }}
</div>`,
})

View File

@ -1,4 +1,4 @@
<div class="container" (dblclick)="onFocusIn()">
<div class="container" (dblclick)="onFocusIn()" (resized)="onEditorHostResize($event)">
<div class="editor-container" *ngIf="showEditor">
<ngx-monaco-editor class="editor"
[options]="editorOptions"
@ -7,5 +7,5 @@
#editor
></ngx-monaco-editor>
</div>
<div class="display markdown-display" markdown katex [data]="contents"></div>
<div class="display markdown-display" markdown katex [data]="contents" *ngIf="!showEditor || (showEditor && !singleColumn)"></div>
</div>

View File

@ -20,6 +20,7 @@ export class MarkdownComponent extends EditorNodeContract implements OnInit {
private dirtyOverride = false;
public showEditor = false;
protected hadOneFocusOut = false;
public singleColumn = false;
public editorOptions = {
theme: this.isDark() ? 'vs-dark' : 'vs',
@ -91,4 +92,12 @@ export class MarkdownComponent extends EditorNodeContract implements OnInit {
this.showEditor = false;
}
}
onEditorHostResize($event) {
if ( $event.newWidth < 700 && !this.singleColumn ) {
this.singleColumn = true;
} else if ( $event.newWidth > 700 && this.singleColumn ) {
this.singleColumn = false;
}
}
}