diff --git a/apps/common/main/lib/controller/ExternalDiagramEditor.js b/apps/common/main/lib/controller/ExternalDiagramEditor.js index ad90550a1..518b24e76 100644 --- a/apps/common/main/lib/controller/ExternalDiagramEditor.js +++ b/apps/common/main/lib/controller/ExternalDiagramEditor.js @@ -141,7 +141,12 @@ define([ handler: function(result, value) { if (this.isHandlerCalled) return; this.isHandlerCalled = true; - externalEditor && externalEditor.serviceCommand('queryClose',{mr:result}); + if (this.diagramEditorView._isExternalDocReady) + externalEditor && externalEditor.serviceCommand('queryClose',{mr:result}); + else { + this.diagramEditorView.hide(); + this.isHandlerCalled = false; + } }, setChartData: function() { diff --git a/apps/common/main/lib/view/ExternalDiagramEditor.js b/apps/common/main/lib/view/ExternalDiagramEditor.js index 511fe6585..29f6e8021 100644 --- a/apps/common/main/lib/view/ExternalDiagramEditor.js +++ b/apps/common/main/lib/view/ExternalDiagramEditor.js @@ -82,11 +82,9 @@ define([ disabled: true }); this.btnCancel = new Common.UI.Button({ - el: $('#id-btn-diagram-editor-cancel'), - disabled: true + el: $('#id-btn-diagram-editor-cancel') }); - this.$window.find('.tool.close').addClass('disabled'); this.$window.find('.dlg-btn').on('click', _.bind(this.onDlgBtnClick, this)); },