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
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.$broadcast("refreshWorkflowChart");
}); });
scope.closeDialog = function() { scope.closeDialog = function(exitWithUnsavedChanges) {
if (scope.workflowChangesUnsaved || scope.workflowChangesStarted) { if (exitWithUnsavedChanges || !(scope.workflowChangesUnsaved || scope.workflowChangesStarted)) {
scope.unsavedChangesVisible = true;
} else {
scope.unsavedChangesVisible = false; scope.unsavedChangesVisible = false;
$('#workflow-modal-dialog').dialog('destroy'); $('#workflow-modal-dialog').dialog('destroy');
$('body').removeClass('WorkflowMaker-preventBodyScrolling'); $('body').removeClass('WorkflowMaker-preventBodyScrolling');
$state.go('^'); $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 class="Prompt-bodyQuery">{{strings.get('workflow_maker.UNSAVED_CHANGES_PROMPT_TEXT')}}</div>
</div> </div>
<div class="Modal-footer"> <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-click="cancelUnsavedChanges()" class="btn Modal-footerButton Modal-defaultButton">{{strings.get('workflow_maker.CANCEL')}}</button>
<button <button
ng-hide="formState.showNodeForm || formState.showLinkForm" ng-hide="formState.showNodeForm || formState.showLinkForm"