Use JQuery Dialog (#11445).

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@10070 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang 2012-07-22 15:42:29 +00:00
parent cd54e15a8d
commit 46b1a49453
2 changed files with 13 additions and 22 deletions

View File

@ -273,33 +273,27 @@ function setPredecessorFieldsVisibility() {
} }
function showModal(id, width) { function showModal(id, width) {
el = $('#'+id).first(); var el = $('#'+id).first();
if (el.length == 0 || el.is(':visible')) {return;} if (el.length == 0 || el.is(':visible')) {return;}
var h = $('body').height(); var title = el.find('h3.title').text();
var d = document.createElement("div"); el.dialog({
d.id = 'modalbg'; width: width,
$(d).appendTo('#main').css('width', '100%').css('height', h + 'px').show(); modal: true,
resizable: false,
var pageWidth = $(window).width(); dialogClass: 'modal',
if (width) { title: title
el.css('width', width); });
}
el.css('left', (((pageWidth - el.width())/2 *100) / pageWidth) + '%');
el.addClass('modal');
el.show();
el.find("input[type=text], input[type=submit]").first().focus(); el.find("input[type=text], input[type=submit]").first().focus();
} }
function hideModal(el) { function hideModal(el) {
var modal; var modal;
if (el) { if (el) {
modal = $(el).parents('div.modal').first(); modal = $(el).parents('.ui-dialog-content');
} else { } else {
modal = $('#ajax-modal'); modal = $('#ajax-modal');
} }
modal.hide(); modal.dialog("close");
$('#modalbg').remove();
} }
function submitPreview(url, form, target) { function submitPreview(url, form, target) {

View File

@ -91,12 +91,9 @@ html>body #content { min-height: 600px; }
#login-form label {font-weight: bold;} #login-form label {font-weight: bold;}
#login-form input#username, #login-form input#password { width: 300px; } #login-form input#username, #login-form input#password { width: 300px; }
#modalbg {position:absolute; top:0; left:0; width:100%; height:100%; background:#ccc; z-index:49; opacity:0.5;} div.modal { border-radius:5px; background:#fff; z-index:50; padding:4px;}
html>body #modalbg {position:fixed;} div.modal h3.title {display:none;}
div.modal { border-radius:5px; position:absolute; top:25%; background:#fff; border:2px solid #759FCF; z-index:50; padding:0px; padding:8px; box-shadow: 1px 1px 8px #888; }
div.modal h3.title {background:#759FCF; color:#fff; border:0; padding-left:8px; margin:-8px; margin-bottom: 1em; border-top-left-radius:2px;border-top-right-radius:2px;}
div.modal p.buttons {text-align:right; margin-bottom:0;} div.modal p.buttons {text-align:right; margin-bottom:0;}
html>body div.modal {position:fixed;}
input#openid_url { background: url(../images/openid-bg.gif) no-repeat; background-color: #fff; background-position: 0 50%; padding-left: 18px; } input#openid_url { background: url(../images/openid-bg.gif) no-repeat; background-color: #fff; background-position: 0 50%; padding-left: 18px; }