From 8f1cdbdbf945df2dc2051dc99d24a1bf6ce5623e Mon Sep 17 00:00:00 2001 From: John Mitchell Date: Thu, 10 Mar 2016 14:50:42 -0500 Subject: [PATCH] fixed modal being open on route change and modal scrolling --- awx/ui/client/legacy-styles/ansible-ui.less | 4 ++++ .../src/access/addPermissions/addPermissions.block.less | 2 -- .../src/access/addPermissions/addPermissions.directive.js | 7 +++++++ awx/ui/client/src/app.js | 1 + 4 files changed, 12 insertions(+), 2 deletions(-) diff --git a/awx/ui/client/legacy-styles/ansible-ui.less b/awx/ui/client/legacy-styles/ansible-ui.less index 742e9a24c1..8b5be38541 100644 --- a/awx/ui/client/legacy-styles/ansible-ui.less +++ b/awx/ui/client/legacy-styles/ansible-ui.less @@ -2066,3 +2066,7 @@ tr td button i { .select2-container--disabled { opacity: .35; } + +body.is-modalOpen { + overflow: hidden; +} diff --git a/awx/ui/client/src/access/addPermissions/addPermissions.block.less b/awx/ui/client/src/access/addPermissions/addPermissions.block.less index e77141818e..87e4e0ee2b 100644 --- a/awx/ui/client/src/access/addPermissions/addPermissions.block.less +++ b/awx/ui/client/src/access/addPermissions/addPermissions.block.less @@ -40,8 +40,6 @@ .AddPermissions-body { padding: 0px 20px; - max-height: 70vh; - overflow: scroll; } .AddPermissions-footer { diff --git a/awx/ui/client/src/access/addPermissions/addPermissions.directive.js b/awx/ui/client/src/access/addPermissions/addPermissions.directive.js index c96f0e3701..a9d21dfff8 100644 --- a/awx/ui/client/src/access/addPermissions/addPermissions.directive.js +++ b/awx/ui/client/src/access/addPermissions/addPermissions.directive.js @@ -18,6 +18,8 @@ export default link: function(scope, element, attrs, ctrl) { scope.toggleFormTabs('users'); + $("body").addClass("is-modalOpen"); + $("body").append(element); Wait('start'); @@ -35,6 +37,7 @@ export default }); scope.closeModal = function() { + $("body").removeClass("is-modalOpen"); $('#add-permissions-modal').on('hidden.bs.modal', function () { $('.AddPermissions').remove(); @@ -42,6 +45,10 @@ export default $('#add-permissions-modal').modal('hide'); }; + scope.$on('closePermissionsModal', function() { + scope.closeModal(); + }); + Wait('stop'); window.scrollTo(0,0); diff --git a/awx/ui/client/src/app.js b/awx/ui/client/src/app.js index 14e955f423..0743630ffc 100644 --- a/awx/ui/client/src/app.js +++ b/awx/ui/client/src/app.js @@ -1055,6 +1055,7 @@ var tower = angular.module('Tower', [ $rootScope.$on("$stateChangeStart", function (event, next, nextParams, prev) { + $rootScope.$broadcast("closePermissionsModal"); // this line removes the query params attached to a route if(prev && prev.$$route && prev.$$route.name === 'systemTracking'){