mirror of
https://github.com/ansible/awx.git
synced 2026-03-07 11:41:08 -03:30
fixed problem with modal windows which solved trello card 269
This commit is contained in:
@@ -249,7 +249,7 @@
|
|||||||
@zindex-tooltip: 1030;
|
@zindex-tooltip: 1030;
|
||||||
@zindex-navbar-fixed: 1030;
|
@zindex-navbar-fixed: 1030;
|
||||||
@zindex-modal-background: 1040;
|
@zindex-modal-background: 1040;
|
||||||
@zindex-modal: 1050;
|
@zindex-modal: 1150;
|
||||||
|
|
||||||
|
|
||||||
//== Media queries breakpoints
|
//== Media queries breakpoints
|
||||||
|
|||||||
2
awx/ui/static/css/ansible-bootstrap.min.css
vendored
2
awx/ui/static/css/ansible-bootstrap.min.css
vendored
File diff suppressed because one or more lines are too long
@@ -155,7 +155,7 @@ function Authenticate($log, $cookieStore, $compile, $window, $scope, $rootScope,
|
|||||||
$('.api-error').empty();
|
$('.api-error').empty();
|
||||||
var token;
|
var token;
|
||||||
if (Empty(username) || Empty(password)) {
|
if (Empty(username) || Empty(password)) {
|
||||||
Alert('Error!', 'Please provide a username and password before attempting to login.', 'alert-danger', setLoginFocus);
|
Alert('Error!', 'Please provide a username and password before attempting to login.', 'alert-danger', setLoginFocus, null, null, false);
|
||||||
} else {
|
} else {
|
||||||
Wait('start');
|
Wait('start');
|
||||||
Authorization.retrieveToken(username, password)
|
Authorization.retrieveToken(username, password)
|
||||||
@@ -185,7 +185,7 @@ function Authenticate($log, $cookieStore, $compile, $window, $scope, $rootScope,
|
|||||||
' and accessible.';
|
' and accessible.';
|
||||||
}
|
}
|
||||||
scope.reset();
|
scope.reset();
|
||||||
Alert(hdr, msg, 'alert-danger', setLoginFocus);
|
Alert(hdr, msg, 'alert-danger', setLoginFocus, null, null, false);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -410,7 +410,8 @@ angular.module('SchedulesHelper', [ 'Utilities', 'RestServices', 'SchedulesHelpe
|
|||||||
Prompt({
|
Prompt({
|
||||||
hdr: hdr,
|
hdr: hdr,
|
||||||
body: "<div class=\"alert alert-info\">Are you sure you want to delete the <em>" + schedule.name + "</em> schedule?</div>",
|
body: "<div class=\"alert alert-info\">Are you sure you want to delete the <em>" + schedule.name + "</em> schedule?</div>",
|
||||||
action: action
|
action: action,
|
||||||
|
backdrop: false
|
||||||
});
|
});
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -76,20 +76,21 @@ angular.module('Utilities', ['RestServices', 'Utilities'])
|
|||||||
* clicks 'OK' button. Set secondAlert to true, when a second dialog is needed.
|
* clicks 'OK' button. Set secondAlert to true, when a second dialog is needed.
|
||||||
*/
|
*/
|
||||||
.factory('Alert', ['$rootScope', function ($rootScope) {
|
.factory('Alert', ['$rootScope', function ($rootScope) {
|
||||||
return function (hdr, msg, cls, action, secondAlert, disableButtons) {
|
return function (hdr, msg, cls, action, secondAlert, disableButtons, backdrop) {
|
||||||
var scope = $rootScope.$new(), alertClass;
|
var scope = $rootScope.$new(), alertClass, local_backdrop;
|
||||||
if (secondAlert) {
|
if (secondAlert) {
|
||||||
|
|
||||||
$('#alertHeader2').html(hdr);
|
$('#alertHeader2').html(hdr);
|
||||||
$('#alert2-modal-msg').html(msg);
|
$('#alert2-modal-msg').html(msg);
|
||||||
|
|
||||||
alertClass = (cls) ? cls : 'alert-danger'; //default alert class is alert-danger
|
alertClass = (cls) ? cls : 'alert-danger'; //default alert class is alert-danger
|
||||||
|
local_backdrop = (backdrop === undefined) ? "static" : backdrop;
|
||||||
|
|
||||||
$('#alert2-modal-msg').attr({ "class": "alert " + alertClass });
|
$('#alert2-modal-msg').attr({ "class": "alert " + alertClass });
|
||||||
$('#alert-modal2').modal({
|
$('#alert-modal2').modal({
|
||||||
show: true,
|
show: true,
|
||||||
keyboard: true,
|
keyboard: true,
|
||||||
backdrop: 'static'
|
backdrop: local_backdrop
|
||||||
});
|
});
|
||||||
scope.disableButtons2 = (disableButtons) ? true : false;
|
scope.disableButtons2 = (disableButtons) ? true : false;
|
||||||
|
|
||||||
@@ -111,11 +112,13 @@ angular.module('Utilities', ['RestServices', 'Utilities'])
|
|||||||
$('#alertHeader').html(hdr);
|
$('#alertHeader').html(hdr);
|
||||||
$('#alert-modal-msg').html(msg);
|
$('#alert-modal-msg').html(msg);
|
||||||
alertClass = (cls) ? cls : 'alert-danger'; //default alert class is alert-danger
|
alertClass = (cls) ? cls : 'alert-danger'; //default alert class is alert-danger
|
||||||
|
local_backdrop = (backdrop === undefined) ? "static" : backdrop;
|
||||||
|
|
||||||
$('#alert-modal-msg').attr({ "class": "alert " + alertClass });
|
$('#alert-modal-msg').attr({ "class": "alert " + alertClass });
|
||||||
$('#alert-modal').modal({
|
$('#alert-modal').modal({
|
||||||
show: true,
|
show: true,
|
||||||
keyboard: true,
|
keyboard: true,
|
||||||
backdrop: 'static'
|
backdrop: local_backdrop
|
||||||
});
|
});
|
||||||
|
|
||||||
$('#alert-modal').on('hidden.bs.modal', function () {
|
$('#alert-modal').on('hidden.bs.modal', function () {
|
||||||
|
|||||||
@@ -22,19 +22,21 @@ angular.module('PromptDialog', ['Utilities'])
|
|||||||
return function (params) {
|
return function (params) {
|
||||||
|
|
||||||
var dialog = angular.element(document.getElementById('prompt-modal')),
|
var dialog = angular.element(document.getElementById('prompt-modal')),
|
||||||
scope = dialog.scope(), cls;
|
scope = dialog.scope(), cls, local_backdrop;
|
||||||
|
|
||||||
scope.promptHeader = params.hdr;
|
scope.promptHeader = params.hdr;
|
||||||
scope.promptBody = $sce.trustAsHtml(params.body);
|
scope.promptBody = $sce.trustAsHtml(params.body);
|
||||||
scope.promptAction = params.action;
|
scope.promptAction = params.action;
|
||||||
|
|
||||||
|
local_backdrop = (params.backdrop === undefined) ? "static" : params.backdrop;
|
||||||
|
|
||||||
cls = (params['class'] === null || params['class'] === undefined) ? 'btn-danger' : params['class'];
|
cls = (params['class'] === null || params['class'] === undefined) ? 'btn-danger' : params['class'];
|
||||||
|
|
||||||
$('#prompt_action_btn').removeClass(cls).addClass(cls);
|
$('#prompt_action_btn').removeClass(cls).addClass(cls);
|
||||||
|
|
||||||
$('#prompt-modal').off('hidden.bs.modal');
|
$('#prompt-modal').off('hidden.bs.modal');
|
||||||
$('#prompt-modal').modal({
|
$('#prompt-modal').modal({
|
||||||
backdrop: 'static',
|
backdrop: local_backdrop,
|
||||||
keyboard: true,
|
keyboard: true,
|
||||||
show: true
|
show: true
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user