From ca2c60551dd620f0c1b76a7f50600dceea7db461 Mon Sep 17 00:00:00 2001 From: Alexander Schwartz Date: Wed, 4 May 2022 12:53:49 +0200 Subject: [PATCH] Prevent double-submit of the form that could lead to a failing request in the backend. As this element is wrapped inside a form, the click would otherwise also submit the form. Closes #11819 --- .../theme/base/admin/resources/js/controllers/clients.js | 5 ++++- .../base/admin/resources/partials/client-scope-mappings.html | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/themes/src/main/resources/theme/base/admin/resources/js/controllers/clients.js b/themes/src/main/resources/theme/base/admin/resources/js/controllers/clients.js index 3ef1b951b43..be4765e3756 100755 --- a/themes/src/main/resources/theme/base/admin/resources/js/controllers/clients.js +++ b/themes/src/main/resources/theme/base/admin/resources/js/controllers/clients.js @@ -2226,8 +2226,11 @@ module.controller('ClientScopeMappingCtrl', function($scope, $http, realm, $rout return $scope.client.fullScopeAllowed; } - $scope.changeFlag = function() { + $scope.changeFlag = function(event) { console.log('changeFlag'); + event.stopPropagation(); + event.preventDefault(); + $scope.client.fullScopeAllowed = !$scope.client.fullScopeAllowed Client.update({ realm : realm.realm, client : client.id diff --git a/themes/src/main/resources/theme/base/admin/resources/partials/client-scope-mappings.html b/themes/src/main/resources/theme/base/admin/resources/partials/client-scope-mappings.html index 1343f1b4c0a..d3896423291 100755 --- a/themes/src/main/resources/theme/base/admin/resources/partials/client-scope-mappings.html +++ b/themes/src/main/resources/theme/base/admin/resources/partials/client-scope-mappings.html @@ -15,7 +15,7 @@ {{:: 'full-scope-allowed.tooltip' | translate}}
- +