fix wf unsaved changes exit functionality

This commit is contained in:
John Mitchell 2019-03-05 14:20:38 -05:00
parent 9f5f86c6a7
commit dc206c9ad6
No known key found for this signature in database
GPG Key ID: FE6A9B5BD4EB5C94
2 changed files with 5 additions and 5 deletions

View File

@ -62,15 +62,15 @@ export default ['templateUrl', 'CreateDialog', 'Wait', '$state', '$window',
scope.$broadcast("refreshWorkflowChart");
});
scope.closeDialog = function() {
if (scope.workflowChangesUnsaved || scope.workflowChangesStarted) {
scope.unsavedChangesVisible = true;
} else {
scope.closeDialog = function(exitWithUnsavedChanges) {
if (exitWithUnsavedChanges || !(scope.workflowChangesUnsaved || scope.workflowChangesStarted)) {
scope.unsavedChangesVisible = false;
$('#workflow-modal-dialog').dialog('destroy');
$('body').removeClass('WorkflowMaker-preventBodyScrolling');
$state.go('^');
} else {
scope.unsavedChangesVisible = true;
}
};

View File

@ -40,7 +40,7 @@
<div class="Prompt-bodyQuery">{{strings.get('workflow_maker.UNSAVED_CHANGES_PROMPT_TEXT')}}</div>
</div>
<div class="Modal-footer">
<button ng-click="closeDialog()" class="btn Modal-footerButton Modal-errorButton">{{strings.get('workflow_maker.EXIT')}}</button>
<button ng-click="closeDialog(true)" class="btn Modal-footerButton Modal-errorButton">{{strings.get('workflow_maker.EXIT')}}</button>
<button ng-click="cancelUnsavedChanges()" class="btn Modal-footerButton Modal-defaultButton">{{strings.get('workflow_maker.CANCEL')}}</button>
<button
ng-hide="formState.showNodeForm || formState.showLinkForm"