Skip to content
Snippets Groups Projects

Anchored nuance to bottom, introduced delay to let it load correctly, and...

Merged Philipp Krop requested to merge master into dev
1 file
+ 24
4
Compare changes
  • Side-by-side
  • Inline
import { Component, NgZone, OnInit } from '@angular/core';
import { Component, NgZone, OnInit, ViewChild } from '@angular/core';
import { ActivatedRoute, NavigationExtras, Router } from '@angular/router';
import { IonTextarea } from '@ionic/angular';
import { LogData } from 'src/app/models/Logdata';
import { Order } from 'src/app/models/Order';
import { Patient } from 'src/app/models/Patient';
@@ -58,6 +59,13 @@ export class OrderZlmPage implements OnInit {
*/
path = "/assets/data/serverdata.json";
@ViewChild(IonTextarea) textArea;
canSubmit: boolean = false;
innerText = "";
/**
* The URL of IELERA.
*
@@ -90,6 +98,7 @@ export class OrderZlmPage implements OnInit {
this.getData();
window.addEventListener("contextmenu", function(e) { e.preventDefault(); })
setInterval(this.checkCanSubmit.bind(this), 1000);
}
/**
@@ -118,12 +127,19 @@ export class OrderZlmPage implements OnInit {
* @return {*} {boolean}
* @memberof OrderZlmPage
*/
canSubmit(): boolean {
if (this.order.spokenText == "" || this.order.spokenText == undefined) return false;
checkCanSubmit() {
// Get the inner text from the text area since dragon directly writes to it
this.textArea.getInputElement().then(element => this.innerText = element.value);
if ((this.order.spokenText == "" || this.order.spokenText == undefined) && (this.innerText == undefined || this.innerText == "")) {
this.canSubmit = false;
return;
}
return true;
this.canSubmit = true;
}
/**
* Continue to the order-structured page.
*
@@ -132,6 +148,10 @@ export class OrderZlmPage implements OnInit {
async submit() {
this.logData.tsDictation = new Date().getTime();
if (this.order.spokenText == undefined || this.order.spokenText == "") {
this.order.spokenText = this.innerText;
}
let navigationExtras: NavigationExtras = {
state: {
patient: this.patient,
Loading