mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-19 04:57:52 +00:00
bugs fixed
This commit is contained in:
@@ -1,11 +1,11 @@
|
||||
<div >
|
||||
<ion-toolbar class="d-flex">
|
||||
<div class="d-flex align-items-center px-20 pt-20 font-25">
|
||||
<div class="d-flex align-items-center px-20 pt-20 font-25-rem">
|
||||
<div class="left cursor-pointer" (click)="close()">
|
||||
<fa-icon icon="chevron-left" class="menu-icon font-awesome-1"></fa-icon>
|
||||
</div>
|
||||
|
||||
<div class="middle add-ellipsis">
|
||||
<div class="middle add-ellipsis font-25-rem">
|
||||
{{Document.Assunto}}
|
||||
</div>
|
||||
|
||||
@@ -21,18 +21,21 @@
|
||||
apiKey="wr5dk69kive0qr9ig6y5spqvlj3a0tsiwnzdsexnz241k69p"
|
||||
[(ngModel)]="editorContent"
|
||||
[init]="{
|
||||
save_onsavecallback: 'onSaveContent',
|
||||
language: 'pt_PT',
|
||||
height: 600,
|
||||
menubar: false,
|
||||
autosave_interval:30,
|
||||
plugins: [
|
||||
'advlist autolink lists link image charmap print preview anchor',
|
||||
'advlist autolink autosave lists link image charmap print preview anchor',
|
||||
'searchreplace visualblocks code fullscreen',
|
||||
'insertdatetime media table paste code help wordcount print'
|
||||
],
|
||||
toolbar:
|
||||
'undo redo | formatselect | bold italic backcolor | \
|
||||
alignleft aligncenter alignright alignjustify | \
|
||||
bullist numlist outdent indent | removeformat | print | help' }"
|
||||
bullist numlist outdent indent | removeformat | print | save | help ' }"
|
||||
|
||||
initialValue='{{content}}'
|
||||
[(ngModel)]="content"
|
||||
(onSaveContent)="somefunction()"
|
||||
|
||||
@@ -1,13 +1,15 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { Component, OnDestroy, OnInit } from '@angular/core';
|
||||
import { NavParams } from '@ionic/angular';
|
||||
import { EventDetailsDocumentsOptionsPage } from '../shared/popover/event-details-documents-options/event-details-documents-options.page';
|
||||
import { AlertController, ModalController } from '@ionic/angular';
|
||||
import { ProcessesService } from '../services/processes.service';
|
||||
import { HttpErrorHandle } from '../services/http-error-handle.service';
|
||||
@Component({
|
||||
selector: 'app-tiny-mce',
|
||||
templateUrl: './tiny-mce.page.html',
|
||||
styleUrls: ['./tiny-mce.page.scss'],
|
||||
})
|
||||
export class TinyMCEPage implements OnInit {
|
||||
export class TinyMCEPage implements OnDestroy {
|
||||
|
||||
|
||||
|
||||
@@ -16,25 +18,30 @@ export class TinyMCEPage implements OnInit {
|
||||
content: ""
|
||||
editorContent: "";
|
||||
value: "";
|
||||
|
||||
private intervalId: any;
|
||||
private intervalTime: number = 30000;
|
||||
|
||||
|
||||
|
||||
constructor(
|
||||
private navParams: NavParams,
|
||||
private modalController: ModalController,
|
||||
|
||||
private processService: ProcessesService,
|
||||
private erroHandler: HttpErrorHandle
|
||||
|
||||
) {
|
||||
this.Document = this.navParams.get('Document')
|
||||
this.content = this.navParams.get('content')
|
||||
|
||||
|
||||
this.waitForTiny();
|
||||
this.saveDraft();
|
||||
}
|
||||
|
||||
waitForTiny() {
|
||||
const tiny: HTMLDivElement = document.querySelector('.tox-tinymce')
|
||||
|
||||
if(tiny) {
|
||||
if (tiny) {
|
||||
this.doneWaitForTiny(tiny)
|
||||
} else {
|
||||
setTimeout(() => {
|
||||
@@ -47,16 +54,39 @@ export class TinyMCEPage implements OnInit {
|
||||
tiny.style.height = '100%'
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
this.value = ""
|
||||
ngOnDestroy() {
|
||||
// Certifique-se de limpar o intervalo quando o componente é destruído
|
||||
if (this.intervalId) {
|
||||
clearInterval(this.intervalId);
|
||||
}
|
||||
}
|
||||
|
||||
close() {
|
||||
this.modalController.dismiss()
|
||||
}
|
||||
|
||||
saveDraft() {
|
||||
this.intervalId = setInterval(() => {
|
||||
// Lógica que deseja executar em intervalos regulares
|
||||
console.log('Intervalo de 30 segundos...');
|
||||
console.log(document)
|
||||
let objectDraft = {
|
||||
"status": false,
|
||||
"description": this.Document.Assunto,
|
||||
"content": this.content,
|
||||
"path": this.Document.path,
|
||||
"ownerId": this.Document.ownerId
|
||||
}
|
||||
this.processService.SaveDraftByID(this.Document.DocId, objectDraft).subscribe((res) => {
|
||||
window['tinyupdate']()
|
||||
}, (error) => {
|
||||
this.erroHandler.httpStatusHandle(error)
|
||||
})
|
||||
}, this.intervalTime);
|
||||
}
|
||||
|
||||
somefunction() {
|
||||
console.log(this.content)
|
||||
|
||||
}
|
||||
|
||||
async openOptions() {
|
||||
@@ -70,7 +100,7 @@ export class TinyMCEPage implements OnInit {
|
||||
});
|
||||
|
||||
|
||||
modal.onDidDismiss().then((res)=>{},() => {})
|
||||
modal.onDidDismiss().then((res) => { }, () => { })
|
||||
|
||||
await modal.present();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user