fixed problem with modal windows which solved trello card 269

This commit is contained in:
Jared Tabor 2014-08-14 16:42:52 -04:00
parent d29a82bcaa
commit bc3a421aaa
6 changed files with 17 additions and 11 deletions

View File

@ -249,7 +249,7 @@
@zindex-tooltip: 1030;
@zindex-navbar-fixed: 1030;
@zindex-modal-background: 1040;
@zindex-modal: 1050;
@zindex-modal: 1150;
//== Media queries breakpoints

File diff suppressed because one or more lines are too long

View File

@ -155,7 +155,7 @@ function Authenticate($log, $cookieStore, $compile, $window, $scope, $rootScope,
$('.api-error').empty();
var token;
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 {
Wait('start');
Authorization.retrieveToken(username, password)
@ -185,7 +185,7 @@ function Authenticate($log, $cookieStore, $compile, $window, $scope, $rootScope,
' and accessible.';
}
scope.reset();
Alert(hdr, msg, 'alert-danger', setLoginFocus);
Alert(hdr, msg, 'alert-danger', setLoginFocus, null, null, false);
}
});
}

View File

@ -410,7 +410,8 @@ angular.module('SchedulesHelper', [ 'Utilities', 'RestServices', 'SchedulesHelpe
Prompt({
hdr: hdr,
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
});
};

View File

@ -76,20 +76,21 @@ angular.module('Utilities', ['RestServices', 'Utilities'])
* clicks 'OK' button. Set secondAlert to true, when a second dialog is needed.
*/
.factory('Alert', ['$rootScope', function ($rootScope) {
return function (hdr, msg, cls, action, secondAlert, disableButtons) {
var scope = $rootScope.$new(), alertClass;
return function (hdr, msg, cls, action, secondAlert, disableButtons, backdrop) {
var scope = $rootScope.$new(), alertClass, local_backdrop;
if (secondAlert) {
$('#alertHeader2').html(hdr);
$('#alert2-modal-msg').html(msg);
alertClass = (cls) ? cls : 'alert-danger'; //default alert class is alert-danger
local_backdrop = (backdrop === undefined) ? "static" : backdrop;
$('#alert2-modal-msg').attr({ "class": "alert " + alertClass });
$('#alert-modal2').modal({
show: true,
keyboard: true,
backdrop: 'static'
backdrop: local_backdrop
});
scope.disableButtons2 = (disableButtons) ? true : false;
@ -111,11 +112,13 @@ angular.module('Utilities', ['RestServices', 'Utilities'])
$('#alertHeader').html(hdr);
$('#alert-modal-msg').html(msg);
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').modal({
show: true,
keyboard: true,
backdrop: 'static'
backdrop: local_backdrop
});
$('#alert-modal').on('hidden.bs.modal', function () {

View File

@ -22,19 +22,21 @@ angular.module('PromptDialog', ['Utilities'])
return function (params) {
var dialog = angular.element(document.getElementById('prompt-modal')),
scope = dialog.scope(), cls;
scope = dialog.scope(), cls, local_backdrop;
scope.promptHeader = params.hdr;
scope.promptBody = $sce.trustAsHtml(params.body);
scope.promptAction = params.action;
local_backdrop = (params.backdrop === undefined) ? "static" : params.backdrop;
cls = (params['class'] === null || params['class'] === undefined) ? 'btn-danger' : params['class'];
$('#prompt_action_btn').removeClass(cls).addClass(cls);
$('#prompt-modal').off('hidden.bs.modal');
$('#prompt-modal').modal({
backdrop: 'static',
backdrop: local_backdrop,
keyboard: true,
show: true
});