mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-20 05:16:07 +00:00
tinymce auto save
This commit is contained in:
@@ -9,9 +9,9 @@
|
||||
{{Document.Assunto}}
|
||||
</div>
|
||||
|
||||
<div class="right cursor-pointer" (click)="openOptions()">
|
||||
<!-- <div class="right cursor-pointer" (click)="openOptions()">
|
||||
<fa-icon icon="ellipsis-v" class="menu-icon font-awesome-1"></fa-icon>
|
||||
</div>
|
||||
</div> -->
|
||||
|
||||
</div>
|
||||
</ion-toolbar>
|
||||
@@ -26,13 +26,16 @@ apiKey="wr5dk69kive0qr9ig6y5spqvlj3a0tsiwnzdsexnz241k69p"
|
||||
plugins: [
|
||||
'advlist autolink lists link image charmap print preview anchor',
|
||||
'searchreplace visualblocks code fullscreen',
|
||||
'insertdatetime media table paste code help wordcount print'
|
||||
'insertdatetime media table paste code help wordcount print autosave'
|
||||
],
|
||||
autosave_ask_before_unload: false,
|
||||
autosave_interval: '30s',
|
||||
toolbar:
|
||||
'undo redo | formatselect | bold italic backcolor | \
|
||||
alignleft aligncenter alignright alignjustify | \
|
||||
bullist numlist outdent indent | removeformat | print | help' }"
|
||||
initialValue='{{content}}'
|
||||
[(ngModel)]="content"
|
||||
(onSaveContent)="somefunction()"
|
||||
(onSaveContent)="saveDraft()"
|
||||
|
||||
></editor>
|
||||
@@ -2,6 +2,8 @@ import { Component, 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',
|
||||
@@ -22,6 +24,8 @@ export class TinyMCEPage implements OnInit {
|
||||
constructor(
|
||||
private navParams: NavParams,
|
||||
private modalController: ModalController,
|
||||
private processService: ProcessesService,
|
||||
private erroHandler: HttpErrorHandle
|
||||
|
||||
) {
|
||||
this.Document = this.navParams.get('Document')
|
||||
@@ -36,9 +40,23 @@ export class TinyMCEPage implements OnInit {
|
||||
this.modalController.dismiss()
|
||||
}
|
||||
|
||||
somefunction() {
|
||||
console.log(this.content)
|
||||
}
|
||||
saveDraft() {
|
||||
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) => [
|
||||
this.erroHandler.httpsSucessMessagge('Draft Save'),
|
||||
this.modalController.dismiss()
|
||||
],(error) => {
|
||||
this.erroHandler.httpStatusHandle(error)
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
async openOptions() {
|
||||
const modal = await this.modalController.create({
|
||||
|
||||
Reference in New Issue
Block a user