Check if width parameter is present.

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@8594 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang 2012-01-09 18:48:36 +00:00
parent c23e497c42
commit 087186ef34
1 changed files with 3 additions and 1 deletions

View File

@ -209,7 +209,9 @@ function showModal(id, width) {
$('modalbg').show();
var pageWidth = document.viewport.getWidth();
el.setStyle({'width': width});
if (width) {
el.setStyle({'width': width});
}
el.setStyle({'left': (((pageWidth - el.getWidth())/2 *100) / pageWidth) + '%'});
el.addClassName('modal');
el.show();