mirror of
https://github.com/documize/community.git
synced 2025-07-24 15:49:44 +02:00
Improved Draw.io integration pending changes detection
This commit is contained in:
parent
8a30f3681c
commit
b1a35b7f75
5 changed files with 693 additions and 680 deletions
|
@ -110,7 +110,15 @@ export default Component.extend({
|
|||
},
|
||||
|
||||
invokeExport() {
|
||||
// Cannot export if nothing has been changed
|
||||
// so we skip straight to the save process.
|
||||
if (is.empty(this.get('diagramXML'))) {
|
||||
this.set('readyToSave', true);
|
||||
return;
|
||||
}
|
||||
|
||||
let editorFrame = document.getElementById(this.get('editorId'));
|
||||
|
||||
editorFrame.contentWindow.postMessage(
|
||||
JSON.stringify(
|
||||
{
|
||||
|
@ -126,7 +134,12 @@ export default Component.extend({
|
|||
if (this.get('readyToSave')) {
|
||||
let page = this.get('page');
|
||||
let meta = this.get('meta');
|
||||
meta.set('rawBody', this.get('diagram'));
|
||||
|
||||
// handle case where no diagram changes were made
|
||||
let dg = this.get('diagram');
|
||||
if (is.empty(dg)) dg = this.get('meta.rawBody');
|
||||
|
||||
meta.set('rawBody', dg);
|
||||
page.set('title', this.get('title'));
|
||||
|
||||
this.set('waiting', false);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue