Wiring in majority of minimap-view
This commit is contained in:
@@ -18,6 +18,7 @@ import { ServiceMessage } from '../../common/types/service-message.type';
|
||||
export class CodeViewBase {
|
||||
public uuid: string = uuid.v4();
|
||||
@Input() public isDefault: boolean = false;
|
||||
@Input() public isMiniMap: boolean = false;
|
||||
public leftSiblingUUID!: string;
|
||||
public rightSiblingUUID!: string;
|
||||
|
||||
@@ -150,16 +151,30 @@ export class CodeViewBase {
|
||||
window.main.toggleFullScreen();
|
||||
}
|
||||
|
||||
public setAsMiniMapView() {
|
||||
this.editor.renderer.showLineNumbers = false;
|
||||
this.editor.renderer.setShowGutter(false);
|
||||
|
||||
this.editor.setReadOnly(true);
|
||||
this.editor.setFontSize(2);
|
||||
this.editor.setHighlightActiveLine(false);
|
||||
this.editor.setHighlightGutterLine(false);
|
||||
this.editor.setShowFoldWidgets(false);
|
||||
this.editor.setShowPrintMargin(false);
|
||||
this.editorElm.nativeElement.parentElement.classList.add("col-1");
|
||||
this.editorElm.nativeElement.parentElement.classList.add("zero-margin-padding");
|
||||
}
|
||||
|
||||
public zoomIn() {
|
||||
this.editor.setFontSize(
|
||||
parseInt(this.editor.getFontSize()) + 1
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
public zoomOut() {
|
||||
this.editor.setFontSize(
|
||||
parseInt(this.editor.getFontSize()) - 1
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
public movelinesUp() {
|
||||
|
@@ -26,7 +26,7 @@ import { ServiceMessage } from '../../common/types/service-message.type';
|
||||
templateUrl: './view.component.html',
|
||||
styleUrl: './view.component.css',
|
||||
host: {
|
||||
'class': 'col'
|
||||
'class': 'col zero-margin-padding'
|
||||
}
|
||||
})
|
||||
export class CodeViewComponent extends CodeViewBase {
|
||||
@@ -34,22 +34,26 @@ export class CodeViewComponent extends CodeViewBase {
|
||||
|
||||
constructor() {
|
||||
super();
|
||||
|
||||
this.editorsService.set(this.uuid, this);
|
||||
}
|
||||
|
||||
|
||||
private ngAfterViewInit(): void {
|
||||
if (this.isDefault) {
|
||||
this.editorsService.setActiveEditor(this.uuid);
|
||||
this.addActiveStyling();
|
||||
}
|
||||
|
||||
this.loadAce();
|
||||
}
|
||||
|
||||
private loadAce(): void {
|
||||
this.configAceAndBindToElement()
|
||||
|
||||
if (this.isDefault) {
|
||||
this.editorsService.setActiveEditor(this.uuid);
|
||||
this.addActiveStyling();
|
||||
}
|
||||
|
||||
if (this.isMiniMap) {
|
||||
this.setAsMiniMapView();
|
||||
return;
|
||||
}
|
||||
|
||||
this.loadAceKeyBindings();
|
||||
this.loadAceEventBindings();
|
||||
}
|
||||
@@ -61,6 +65,7 @@ export class CodeViewComponent extends CodeViewBase {
|
||||
|
||||
this.editor = ace.edit( this.editorElm.nativeElement );
|
||||
this.editor.setOptions( this.editorSettings.CONFIG );
|
||||
this.editorsService.set(this.uuid, this);
|
||||
}
|
||||
|
||||
private loadAceKeyBindings(): void {
|
||||
|
Reference in New Issue
Block a user