mirror of
https://github.com/ansible/awx.git
synced 2026-03-22 11:25:08 -02:30
Remove open modals when logging in
If the session times out, and the user attempts to open a modal dialog, then it must be closed due to the fact that bootstrap modals do not work with more than one modal open. The login modal is a bootstrap modal so all other modals need to be closed when it is shown.
This commit is contained in:
@@ -437,7 +437,7 @@ angular.module('Tower', [
|
|||||||
}])
|
}])
|
||||||
|
|
||||||
.run(['$compile', '$cookieStore', '$rootScope', '$log', 'CheckLicense', '$location', 'Authorization', 'LoadBasePaths', 'Timer', 'ClearScope', 'HideStream', 'Socket',
|
.run(['$compile', '$cookieStore', '$rootScope', '$log', 'CheckLicense', '$location', 'Authorization', 'LoadBasePaths', 'Timer', 'ClearScope', 'HideStream', 'Socket',
|
||||||
'LoadConfig', 'Store', 'ShowSocketHelp', 'LicenseViewer', 'AboutAnsibleHelp', 'ConfigureTower', 'CreateCustomInventory' ,
|
'LoadConfig', 'Store', 'ShowSocketHelp', 'LicenseViewer', 'AboutAnsibleHelp', 'ConfigureTower', 'CreateCustomInventory',
|
||||||
function ($compile, $cookieStore, $rootScope, $log, CheckLicense, $location, Authorization, LoadBasePaths, Timer, ClearScope, HideStream, Socket,
|
function ($compile, $cookieStore, $rootScope, $log, CheckLicense, $location, Authorization, LoadBasePaths, Timer, ClearScope, HideStream, Socket,
|
||||||
LoadConfig, Store, ShowSocketHelp, LicenseViewer, AboutAnsibleHelp, ConfigureTower, CreateCustomInventory) {
|
LoadConfig, Store, ShowSocketHelp, LicenseViewer, AboutAnsibleHelp, ConfigureTower, CreateCustomInventory) {
|
||||||
|
|
||||||
|
|||||||
@@ -60,12 +60,14 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
function Authenticate($log, $cookieStore, $compile, $window, $rootScope, $location, Authorization, ToggleClass, Alert, Wait,
|
function Authenticate($log, $cookieStore, $compile, $window, $rootScope, $location, Authorization, ToggleClass, Alert, Wait,
|
||||||
Timer, Empty) {
|
Timer, Empty, ClearScope) {
|
||||||
|
|
||||||
var setLoginFocus, lastPath, sessionExpired, loginAgain,
|
var setLoginFocus, lastPath, sessionExpired, loginAgain,
|
||||||
e, html, scope = $rootScope.$new();
|
e, html, scope = $rootScope.$new();
|
||||||
|
|
||||||
setLoginFocus = function () {
|
setLoginFocus = function () {
|
||||||
|
// Need to clear out any open dialog windows that might be open when this modal opens.
|
||||||
|
ClearScope();
|
||||||
$('#login-username').focus();
|
$('#login-username').focus();
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -249,5 +251,5 @@ function Authenticate($log, $cookieStore, $compile, $window, $rootScope, $locati
|
|||||||
}
|
}
|
||||||
|
|
||||||
Authenticate.$inject = ['$log', '$cookieStore', '$compile', '$window', '$rootScope', '$location', 'Authorization', 'ToggleClass', 'Alert', 'Wait',
|
Authenticate.$inject = ['$log', '$cookieStore', '$compile', '$window', '$rootScope', '$location', 'Authorization', 'ToggleClass', 'Alert', 'Wait',
|
||||||
'Timer', 'Empty'
|
'Timer', 'Empty', 'ClearScope'
|
||||||
];
|
];
|
||||||
|
|||||||
@@ -40,6 +40,10 @@ angular.module('Utilities', ['RestServices', 'Utilities'])
|
|||||||
$(this).remove();
|
$(this).remove();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
$('.ui-dialog-content').each(function(){
|
||||||
|
$(this).dialog('close');
|
||||||
|
});
|
||||||
|
|
||||||
try {
|
try {
|
||||||
$('#help-modal').dialog('close');
|
$('#help-modal').dialog('close');
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
|||||||
Reference in New Issue
Block a user