Skip to content
This repository has been archived by the owner on Nov 25, 2020. It is now read-only.

Commit

Permalink
Modal: handle case where dialogTitle is positioned absolute. Modify C…
Browse files Browse the repository at this point in the history
…SS accordingly.
  • Loading branch information
cdujeu committed Feb 17, 2015
1 parent 5b1f4a9 commit 641b1c6
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 12 deletions.
2 changes: 1 addition & 1 deletion core/src/plugins/gui.ajax/res/js/ajaxplorer.js

Large diffs are not rendered by default.

24 changes: 20 additions & 4 deletions core/src/plugins/gui.ajax/res/js/ajaxplorer/class.Modal.js
Expand Up @@ -479,10 +479,17 @@ Class.create("Modal", {
boxHeight = element.getHeight();
}
}else if(!checkHeight && dContentScrollHeight > winHeight){
dContent.setStyle({
height:(winHeight- parseInt(dTitle.getHeight()) - 20)+'px',
overflow:'auto'
});
if(dTitle.getStyle('position') == 'absolute'){
dContent.setStyle({
height:(winHeight)+'px',
overflow:'auto'
});
}else{
dContent.setStyle({
height:(winHeight- parseInt(dTitle.getHeight()) - 20)+'px',
overflow:'auto'
});
}
if (window.ajxpMobile){
attachMobileScroll(dContent, "vertical");
}
Expand All @@ -492,6 +499,15 @@ Class.create("Modal", {
boxHeight = element.getHeight();
}

if(dTitle.getStyle('position') == 'absolute'){
var innerH = 0;
$A(dContent.childNodes).each(function(c){
if(c.getHeight) innerH += c.getHeight();
});
var topPadding = Math.min(winHeight*25/100, Math.max(0, parseInt((winHeight - innerH)/2)));
dContent.setStyle({paddingTop: topPadding + 'px'});
}

var offsetLeft = parseInt((winWidth - parseInt(boxWidth)) / 2);
var offsetTop = parseInt(((winHeight - parseInt(boxHeight))/3));

Expand Down
6 changes: 4 additions & 2 deletions core/src/plugins/gui.ajax/res/themes/orbit/css/ajaxplorer.css
Expand Up @@ -1327,7 +1327,8 @@ div.dialogBox.form-login_form_dynamic div.dialogContent
height: 100%;
background-color: transparent;
color: white;
padding-top: 37% !important;
transition: padding-top 0.5s;
-webkit-transition: padding-top 0.5s;
}

div.dialogBox.form-switch_language_form div.dialogTitle,
Expand All @@ -1338,7 +1339,8 @@ div.dialogBox.form-login_form_dynamic div.dialogTitle
{
display: block !important;
position: absolute;
top: 35%;
top: 0;
height: 90% !important;
right: -113%;
background-color: transparent;
}
Expand Down
6 changes: 3 additions & 3 deletions core/src/plugins/gui.ajax/res/themes/orbit/css/allz.css

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions core/src/plugins/gui.ajax/res/themes/orbit/css/media.css
Expand Up @@ -181,8 +181,8 @@ and (max-width : 420px){
}

div.dialogBox.form-login_form div.dialogContent, div.dialogBox.form-login_form_dynamic div.dialogContent {
height: 100%;
padding-top: 20%!important;
/*height: 100%;
padding-top: 20%!important;*/
}

#login_form, #login_form_dynamic {
Expand Down

0 comments on commit 641b1c6

Please sign in to comment.