Skip to content

Commit

Permalink
AIRAVATA-3700 Handle ENTER key submission of new project form
Browse files Browse the repository at this point in the history
  • Loading branch information
machristie committed Jun 27, 2023
1 parent bd36538 commit 3912dec
Showing 1 changed file with 10 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
id="modal-new-project"
ref="modalNewProject"
title="Create New Project"
v-on:ok="onCreateProject"
v-on:ok="onOkClicked"
v-bind:ok-disabled="okDisabled"
@cancel="onCancelNewProject"
>
Expand Down Expand Up @@ -40,9 +40,10 @@ export default {
ProjectEditor,
},
methods: {
onCreateProject: function (event) {
// Prevent hiding modal, hide it programmatically when project gets created
event.preventDefault();
onCreateProject: function () {
if (!this.valid) {
return;
}
services.ProjectService.create({ data: this.newProject }).then(
(result) => {
this.$refs.modalNewProject.hide();
Expand All @@ -53,6 +54,11 @@ export default {
}
);
},
onOkClicked(event) {
// Prevent hiding modal, hide it programmatically when project gets created
event.preventDefault();
this.onCreateProject();
},
onCancelNewProject() {
this.newProject = new models.Project();
this.$refs.projectEditor.reset();
Expand Down

0 comments on commit 3912dec

Please sign in to comment.