From 502efe42c98bb427602a4f1fc2267c74e305736d Mon Sep 17 00:00:00 2001 From: Stian Thorgersen Date: Wed, 13 May 2015 11:50:17 +0200 Subject: [PATCH] KEYCLOAK-1288 --- .../resources/theme/base/admin/resources/js/app.js | 1 - .../theme/base/admin/resources/js/controllers/realm.js | 4 ---- .../theme/base/admin/resources/js/services.js | 10 +++------- 3 files changed, 3 insertions(+), 12 deletions(-) diff --git a/forms/common-themes/src/main/resources/theme/base/admin/resources/js/app.js b/forms/common-themes/src/main/resources/theme/base/admin/resources/js/app.js index 2a470e2854..56f600825b 100755 --- a/forms/common-themes/src/main/resources/theme/base/admin/resources/js/app.js +++ b/forms/common-themes/src/main/resources/theme/base/admin/resources/js/app.js @@ -1399,7 +1399,6 @@ module.directive('kcReadOnly', function() { scope.$watch(attrs.kcReadOnly, function(readOnly) { if (readOnly) { - console.debug('readonly'); element.find('input').each(disable); element.find('button').each(disable); element.find('select').each(disable); diff --git a/forms/common-themes/src/main/resources/theme/base/admin/resources/js/controllers/realm.js b/forms/common-themes/src/main/resources/theme/base/admin/resources/js/controllers/realm.js index 32316406e9..52e7fac146 100755 --- a/forms/common-themes/src/main/resources/theme/base/admin/resources/js/controllers/realm.js +++ b/forms/common-themes/src/main/resources/theme/base/admin/resources/js/controllers/realm.js @@ -122,10 +122,6 @@ module.controller('RealmDropdownCtrl', function($scope, Realm, Current, Auth, $l $scope.changeRealm = function(selectedRealm) { $location.url("/realms/" + selectedRealm); } - - $scope.refresh = function() { - Current.refresh(); - } }); module.controller('RealmCreateCtrl', function($scope, Current, Realm, $upload, $http, WhoAmI, $location, Dialog, Notifications, Auth) { diff --git a/forms/common-themes/src/main/resources/theme/base/admin/resources/js/services.js b/forms/common-themes/src/main/resources/theme/base/admin/resources/js/services.js index 1b4302797a..e9f09a28a7 100755 --- a/forms/common-themes/src/main/resources/theme/base/admin/resources/js/services.js +++ b/forms/common-themes/src/main/resources/theme/base/admin/resources/js/services.js @@ -830,15 +830,13 @@ module.factory('ClientOrigins', function($resource) { }); }); -module.factory('Current', function(Realm, $route) { +module.factory('Current', function(Realm, $route, $rootScope) { var current = {}; current.realms = {}; current.realm = null; - current.clients = {}; - current.client = null; - current.refresh = function() { + $rootScope.$on('$routeChangeStart', function() { current.realm = null; current.realms = Realm.query(null, function(realms) { if ($route.current.params.realm) { @@ -849,9 +847,7 @@ module.factory('Current', function(Realm, $route) { } } }); - } - - current.refresh(); + }); return current; });