Add logic to the editor service for saving
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
@@ -6,7 +6,7 @@
|
||||
</ion-buttons>
|
||||
<ion-title #titleBar>
|
||||
<ion-input
|
||||
[(ngModel)]="pageName"
|
||||
[(ngModel)]="editorService.mutablePageName"
|
||||
placeholder="Click to edit page name..."
|
||||
class="title-input"
|
||||
></ion-input>
|
||||
@@ -17,10 +17,21 @@
|
||||
<ion-content>
|
||||
<ng-container>
|
||||
<div class="editor-root ion-padding">
|
||||
<div class="host-container" style="display: flex;">
|
||||
<editor-norm style="flex: 1;"></editor-norm>
|
||||
<div
|
||||
class="host-container"
|
||||
style="display: flex;"
|
||||
*ngFor="let node of editorService.immutableNodes"
|
||||
>
|
||||
<ng-container *ngIf="node.isNorm()">
|
||||
<editor-norm style="flex: 1;" [nodeId]="node.UUID"></editor-norm>
|
||||
</ng-container>
|
||||
</div>
|
||||
</div>
|
||||
<!-- <div class="editor-root ion-padding">-->
|
||||
<!-- <div class="host-container" style="display: flex;">-->
|
||||
<!-- <editor-norm style="flex: 1;"></editor-norm>-->
|
||||
<!-- </div>-->
|
||||
<!-- </div>-->
|
||||
</ng-container>
|
||||
</ion-content>
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import {Component, Host, Input, OnInit, ViewChild, ViewChildren} from '@angular/core';
|
||||
import {Component, Host, HostListener, Input, OnInit, ViewChild, ViewChildren} from '@angular/core';
|
||||
import HostRecord from '../../structures/HostRecord';
|
||||
import PageRecord from '../../structures/PageRecord';
|
||||
import {PageService} from '../../service/page.service';
|
||||
@@ -6,6 +6,7 @@ import {ActivatedRoute, Router} from '@angular/router';
|
||||
import {LoadingController, PopoverController} from '@ionic/angular';
|
||||
import {NodePickerComponent} from '../../components/editor/node-picker/node-picker.component';
|
||||
import {HostOptionsComponent} from '../../components/editor/host-options/host-options.component';
|
||||
import {EditorService} from '../../service/editor.service';
|
||||
|
||||
@Component({
|
||||
selector: 'app-editor',
|
||||
@@ -23,6 +24,7 @@ export class EditorPage implements OnInit {
|
||||
protected route: ActivatedRoute,
|
||||
protected router: Router,
|
||||
protected loader: LoadingController,
|
||||
public readonly editorService: EditorService,
|
||||
) {
|
||||
this.route.params.subscribe(params => {
|
||||
this.pageId = params.id;
|
||||
@@ -31,6 +33,20 @@ export class EditorPage implements OnInit {
|
||||
|
||||
ngOnInit() {}
|
||||
|
||||
ionViewDidEnter() {
|
||||
if ( this.pageId ) {
|
||||
this.editorService.startEditing(this.pageId);
|
||||
} else {
|
||||
this.router.navigate(['/home']);
|
||||
}
|
||||
}
|
||||
|
||||
@HostListener('document:keydown.control.s', ['$event'])
|
||||
onManualSave(event) {
|
||||
event.preventDefault();
|
||||
this.editorService.save();
|
||||
}
|
||||
|
||||
// buttonIsVisible(index) {
|
||||
// return this.visibleButtons.includes(index);
|
||||
// }
|
||||
|
||||
Reference in New Issue
Block a user