diff --git a/public/directives/editUserApiInfoModal.html b/public/directives/editUserApiInfoModal.html index d46029e..fe16db4 100644 --- a/public/directives/editUserApiInfoModal.html +++ b/public/directives/editUserApiInfoModal.html @@ -11,11 +11,9 @@
API Active:
-
- {{apiActive}}
-
+
- toggle
+ toggle
diff --git a/public/js/AdminCtrl.js b/public/js/AdminCtrl.js index bd0a2af..586fb96 100644 --- a/public/js/AdminCtrl.js +++ b/public/js/AdminCtrl.js @@ -57,15 +57,12 @@ polr.directive('editUserApiInfoModal', function () { } // Toggle API access status - $scope.toggleAPIStatus = function($event) { - var el = $($event.target); - var status_display_elem = el.prevAll('.status-display'); - + $scope.toggleAPIStatus = function() { apiCall('admin/toggle_api_active', { 'user_id': $scope.userId, }, function(new_status) { - new_status = res_value_to_text(new_status); - status_display_elem.text(new_status); + $scope.apiActive = res_value_to_text(new_status); + $scope.$digest(); }); };