Skip to content

Commit

Permalink
close options dialog on success
Browse files Browse the repository at this point in the history
  • Loading branch information
cbellone committed May 8, 2023
1 parent 5f3bff2 commit babe92b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<div class="modal-body">
<ticket-category-configuration data-ng-if="ticketCategory.id !== undefined" data-category="ticketCategory" data-event="event" data-close-modal="$close('')"></ticket-category-configuration>
<ticket-category-configuration data-ng-if="ticketCategory.id !== undefined" data-category="ticketCategory" data-event="event" data-close-modal="$close('')" data-on-save="$close('')"></ticket-category-configuration>
<div class="clearfix"></div>
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -660,7 +660,8 @@
scope: {
event: '=',
category: '=',
closeModal: '&'
closeModal: '&',
onSave: '&'
},
bindToController: true,
controller: ['ConfigurationService', '$rootScope', 'GroupService', '$q', CategoryConfigurationController],
Expand Down Expand Up @@ -700,14 +701,15 @@
return;
}
categoryConf.loading = true;
var onSaveComplete = categoryConf.onSave ? categoryConf.onSave : load;

ConfigurationService.updateCategoryConfig(categoryConf.category.id, categoryConf.event.id, categoryConf.settings).then(function() {
if(categoryConf.group) {
GroupService.linkTo(categoryConf.group).then(function() {
load();
onSaveComplete();
});
} else {
load();
onSaveComplete();
}
}, function(e) {
alert(e.data);
Expand Down

0 comments on commit babe92b

Please sign in to comment.