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

Commit

Permalink
JS: modal resize vertically. New EmptyNodeProvider for pages-only dri…
Browse files Browse the repository at this point in the history
…vers.
  • Loading branch information
cdujeu committed Jul 24, 2014
1 parent 37fc6da commit 62902d4
Show file tree
Hide file tree
Showing 4 changed files with 75 additions and 13 deletions.
2 changes: 1 addition & 1 deletion core/src/plugins/gui.ajax/res/js/ajaxplorer.js

Large diffs are not rendered by default.

@@ -0,0 +1,45 @@
/*
* Copyright 2007-2013 Charles du Jeu - Abstrium SAS <team (at) pyd.io>
* This file is part of Pydio.
*
* Pydio is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Pydio is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with Pydio. If not, see <http://www.gnu.org/licenses/>.
*
* The latest code can be found at <http://pyd.io/>.
*/
/**
* A local implementation that explore currently defined
* classes
*/
Class.create("EmptyNodeProvider", {
__implements : "IAjxpNodeProvider",

initialize : function(){

},

initProvider : function(properties){
this.properties = properties;
},

/**
*
* @param node AjxpNode
* @param nodeCallback Function
* @param childCallback Function
*/
loadNode : function(node, nodeCallback, childCallback){

}

});
40 changes: 28 additions & 12 deletions core/src/plugins/gui.ajax/res/js/ajaxplorer/class.Modal.js
Expand Up @@ -251,11 +251,8 @@ Class.create("Modal", {
}
$(elementName).setStyle({height:boxHeight+'px'});
}else{
//if (Prototype.Browser.IE){
//$(elementName).setStyle({height:'1%'});
//}else{
$(elementName).setStyle({height:'auto'});
//}
$(elementName).setStyle({height:'auto'});
$(elementName).down('.dialogContent').setStyle({height:'auto'});
}
this.refreshDialogPosition();
if(boxAutoResize && (this.currentListensToWidth || this.currentListensToHeight) ){
Expand Down Expand Up @@ -352,10 +349,10 @@ Class.create("Modal", {
$(element).down("#element_overlay").insert({after:box});
$(element).down("#element_overlay").setStyle({opacity:0.9});
if(element.up('div.dialogBox')){
Effect.BlindDown(box, {
duration:0.6,
transition:Effect.Transitions.sinoidal
});
//Effect.BlindDown(box, {
// duration:0.6,
// transition:Effect.Transitions.sinoidal
//});
}
}
this.currentLightBoxElement = $(element);
Expand Down Expand Up @@ -433,7 +430,10 @@ Class.create("Modal", {
var element = $(this.elementName);
var boxWidth = element.getWidth();
var boxHeight = element.getHeight();

var dContent = element.down('.dialogContent');
var dContentScrollHeight = dContent.scrollHeight;
var dTitle = element.down('.dialogTitle');

if(checkHeight && boxHeight > parseInt(winHeight*90/100)){
var maxHeight = parseInt(winHeight*90/100);
var crtScrollHeight = elementToScroll.getHeight();
Expand All @@ -442,10 +442,26 @@ Class.create("Modal", {
elementToScroll.setStyle({
overflow:'auto',
height:(maxHeight-crtOffset)+'px'
});
});
if (window.ajxpMobile){
attachMobileScroll(dContent, "vertical");
}
boxHeight = element.getHeight();
}
}
}else if(!checkHeight && dContentScrollHeight > winHeight){
dContent.setStyle({
height:(winHeight- parseInt(dTitle.getHeight()) - 20)+'px',
overflow:'auto'
});
if (window.ajxpMobile){
attachMobileScroll(dContent, "vertical");
}
boxHeight = element.getHeight();
}else if(dContentScrollHeight > dContent.getHeight()){
dContent.setStyle({height: 'auto'});
boxHeight = element.getHeight();
}

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

Expand Down
1 change: 1 addition & 0 deletions core/src/plugins/gui.ajax/res/js/ajaxplorer_list.txt
Expand Up @@ -28,6 +28,7 @@ js/lib/webfx/ajxptree.js
js/ajaxplorer/class.User.js
js/ajaxplorer/class.ResourcesManager.js
js/ajaxplorer/class.RemoteNodeProvider.js
js/ajaxplorer/class.EmptyNodeProvider.js
js/ajaxplorer/class.Repository.js
js/ajaxplorer/class.AjxpDraggable.js
js/ajaxplorer/class.AjxpSortable.js
Expand Down

0 comments on commit 62902d4

Please sign in to comment.