mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-19 04:57:52 +00:00
Improve tinymce autosave and notification web click solved
This commit is contained in:
@@ -26,7 +26,7 @@
|
||||
language: 'pt_PT',
|
||||
height: 600,
|
||||
menubar: false,
|
||||
autosave_interval:30,
|
||||
autosave_interval:'3s',
|
||||
plugins: [
|
||||
'advlist autolink autosave lists link image charmap print preview anchor',
|
||||
'searchreplace visualblocks code fullscreen',
|
||||
@@ -40,4 +40,5 @@
|
||||
initialValue='{{content}}'
|
||||
[(ngModel)]="content"
|
||||
(onSaveContent)="somefunction()"
|
||||
(ngModelChange)="onEditorContentChange()"
|
||||
></editor>
|
||||
@@ -19,7 +19,7 @@ export class TinyMCEPage implements OnDestroy {
|
||||
editorContent: "";
|
||||
value: "";
|
||||
private intervalId: any;
|
||||
private intervalTime: number = 30000;
|
||||
private intervalTime: number = 3000;
|
||||
|
||||
loadingTiny = true
|
||||
|
||||
@@ -37,7 +37,7 @@ export class TinyMCEPage implements OnDestroy {
|
||||
|
||||
|
||||
this.waitForTiny();
|
||||
this.saveDraft();
|
||||
/* this.saveDraft(); */
|
||||
}
|
||||
|
||||
waitForTiny() {
|
||||
@@ -59,37 +59,39 @@ export class TinyMCEPage implements OnDestroy {
|
||||
|
||||
ngOnDestroy() {
|
||||
// Certifique-se de limpar o intervalo quando o componente é destruído
|
||||
if (this.intervalId) {
|
||||
clearInterval(this.intervalId);
|
||||
}
|
||||
window['tinyupdate']()
|
||||
}
|
||||
|
||||
close() {
|
||||
this.modalController.dismiss()
|
||||
}
|
||||
|
||||
onEditorContentChange() {
|
||||
console.log('Autosave successful! Content saved to local storage1.');
|
||||
this.saveDraft()
|
||||
}
|
||||
|
||||
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);
|
||||
// Lógica que deseja executar em intervalos regulares
|
||||
console.log('Intervalo de 3 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) => {
|
||||
console.log('Saved tinymce')
|
||||
|
||||
}, (error) => {
|
||||
this.erroHandler.httpStatusHandle(error)
|
||||
})
|
||||
}
|
||||
|
||||
somefunction() {
|
||||
|
||||
console.log('Saved tinymce')
|
||||
}
|
||||
|
||||
async openOptions() {
|
||||
|
||||
Reference in New Issue
Block a user