Browse Source

fixes #184: close button of quick ticket

Davide Alberani 7 years ago
parent
commit
de2a852c64
1 changed files with 4 additions and 4 deletions
  1. 4 4
      angular_app/js/controllers.js

+ 4 - 4
angular_app/js/controllers.js

@@ -595,9 +595,9 @@ eventManControllers.controller('EventTicketsCtrl', ['$scope', '$state', 'Event',
                     $state.go('event.ticket.edit', {id: $scope.event._id, ticket_id: ret_ticket._id});
                 } else {
                     $scope.query = '';
-                    if ($scope.$close) {
+                    if ($scope.modalInstance) {
                         // Close the Quick ticket modal.
-                        $scope.$close();
+                        $scope.modalInstance.dismiss('no reason');
                     }
                     var msg = $scope.buildTicketLabel(ret_ticket);
                     msg += ' successfully added to event ' + $scope.event.title;
@@ -651,8 +651,8 @@ eventManControllers.controller('EventTicketsCtrl', ['$scope', '$state', 'Event',
         $scope.cancelForm = function() {
             if (!$state.is('event.tickets')) {
                 $state.go('events');
-            } else if ($scope.$close) {
-                $scope.$close();
+            } else if ($scope.modalInstance) {
+                $scope.modalInstance.dismiss('no reason');
             }
         };