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

Commit

Permalink
Fix modal resizing issue
Browse files Browse the repository at this point in the history
  • Loading branch information
cdujeu committed Oct 28, 2014
1 parent 21c8106 commit c1c1236
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
2 changes: 1 addition & 1 deletion core/src/plugins/action.updater/manifest.xml
Expand Up @@ -71,7 +71,7 @@
<dialogOnCancel><![CDATA[]]></dialogOnCancel>
</clientCallback>
<clientForm id="upgrade_form"><![CDATA[
<div id="upgrade_form" action="perform_upgrade" box_width="70%" box_height="85%">
<div id="upgrade_form" action="perform_upgrade" box_width="70%" box_height="85%" box_resize="true">
<div id="upgrade_checking"></div>
<div id="upgrade_status" style="display:none;">
<p><div id="start_upgrade_button" style="float: right;border: 1px solid #BBB;padding: 7px;-moz-border-radius:5px;-webkit-border-radius:5px;border-radius: 5px;background-color: #EEE;color: #333;margin-left: 5px;border-image: initial;box-shadow: 1px 1px 7px #ddd;cursor: pointer;font-weight: bold;"> AJXP_MESSAGE[updater.4] </div>AJXP_MESSAGE[updater.3]</p>
Expand Down
2 changes: 1 addition & 1 deletion core/src/plugins/gui.ajax/res/js/ajaxplorer.js

Large diffs are not rendered by default.

11 changes: 9 additions & 2 deletions core/src/plugins/gui.ajax/res/js/ajaxplorer/class.Modal.js
Expand Up @@ -221,6 +221,9 @@ Class.create("Modal", {
* @param boxWidth String Width in pixel or in percent
* @param boxHeight String Height in pixel or in percent
* @param skipShadow Boolean Do not add a shadow
* @param boxAutoResize Boolean whether box should be resized on window resize event
* @param overlayStyle String additional CSS string to be applied to overlay element
* @param formId String If this id is not null, dialog will have the class form-formId
*/
showContent: function(elementName, boxWidth, boxHeight, skipShadow, boxAutoResize, overlayStyle, formId){
ajaxplorer.disableShortcuts();
Expand Down Expand Up @@ -268,8 +271,9 @@ Class.create("Modal", {
}
if(this.currentListensToHeight){
var winHeight = document.viewport.getHeight();
boxH = parseInt((winHeight * this.currentListensToHeight) / 100);
var boxH = parseInt((winHeight * this.currentListensToHeight) / 100);
$(elementName).setStyle({height:boxH+'px'});
fitHeightToBottom($(elementName).down('.dialogContent'));
}
this.notify("modal:resize");
}.bind(this);
Expand All @@ -295,10 +299,13 @@ Class.create("Modal", {
refreshPNGImages(this.dialogContent);
}

if(this.currentResizeListener) this.currentResizeListener();

},
/**
* Find an editor using the editorData and initialize it
* @param editorData Object
* @param editorArgument Object
*/
openEditorDialog : function(editorData, editorArgument){
if(!editorData.formId){
Expand Down Expand Up @@ -477,7 +484,7 @@ Class.create("Modal", {
attachMobileScroll(dContent, "vertical");
}
boxHeight = element.getHeight();
}else if(dContentScrollHeight >= dContent.getHeight()){
}else if(dContentScrollHeight >= dContent.getHeight() && !this.currentListensToHeight){
dContent.setStyle({height: 'auto'});
boxHeight = element.getHeight();
}
Expand Down

0 comments on commit c1c1236

Please sign in to comment.