Integrate Harry's modifications to reload pop-up content
This commit is contained in:
1 parent
b002c411ce
commit
ea19f11fe2
5 files changed
+84
-8
No files matched your search
@@ -375,16 +375,24 @@ modalWindow : function(settings,callbackFn){
|
||||
var tempheight = settings.height;
|
||||
var tempwidth = settings.width;
|
||||
|
||||
var maxheight = (rgmaskHeight*85)/100;
|
||||
var maxwidth = (rgmaskWidth*85)/100;
|
||||
|
||||
if(typeof tempheight!="undefined"){
|
||||
if(tempheight.charAt(tempheight.length-1)=='%')
|
||||
tempheight=(rgmaskHeight*parseInt(tempheight.substr(0,tempheight.length)))/100;
|
||||
if(tempheight>maxheight)
|
||||
tempheight=maxheight;
|
||||
}else{tempheight="auto";}
|
||||
|
||||
if(typeof tempwidth!="undefined"){
|
||||
if(tempwidth.charAt(tempwidth.length-1)=='%')
|
||||
tempwidth=(rgmaskWidth*parseInt(tempwidth.substr(0,tempwidth.length)))/100;
|
||||
if(tempwidth>maxwidth)
|
||||
tempwidth=maxwidth;
|
||||
}else{tempwidth="auto";}
|
||||
|
||||
|
||||
$rss("body").append('<div class="rgmask" id="rgsheath" style="height:'+rgmaskHeight+'px"></div>');
|
||||
$rss("#rgsheath").css({background: "#000", width: "100%", position: "fixed", top: 0, left: 0,opacity:0.9,'z-index':199});
|
||||
$rss("body").append('<div id="rgWindow"></div>');
|
||||
@@ -410,14 +418,19 @@ modalWindow : function(settings,callbackFn){
|
||||
rgWTop = (rgmaskHeight-tempheight)/2;
|
||||
else{
|
||||
tempheight=$rss("#rgWindow").height();
|
||||
if(tempheight>maxheight)
|
||||
tempheight=maxheight;
|
||||
rgWTop=(rgmaskHeight-tempheight)/2;
|
||||
}
|
||||
if(tempwidth!="auto")
|
||||
rgWLeft = (rgmaskWidth-tempwidth)/2;
|
||||
else{
|
||||
tempwidth=$rss("#rgWindow").width();
|
||||
if(tempwidth>maxwidth)
|
||||
tempwidth=maxwidth;
|
||||
rgWLeft=(rgmaskWidth-tempwidth)/2;
|
||||
}
|
||||
tempwidth+=25;
|
||||
$rss("#rgWindow").empty().show();
|
||||
var closebtn = "";
|
||||
if(closeBtn)
|
||||
@@ -443,6 +456,65 @@ modalWindow : function(settings,callbackFn){
|
||||
});
|
||||
}
|
||||
},
|
||||
modalWindowUpdate : function(settings,callbackFn){
|
||||
var rgmaskHeight = $rss(window).height();
|
||||
var rgmaskWidth = $rss(window).width();
|
||||
var tempheight = settings.height;
|
||||
var tempwidth = settings.width;
|
||||
var dhtml = "";
|
||||
var maxheight = (rgmaskHeight*85)/100;
|
||||
var maxwidth = (rgmaskWidth*85)/100;
|
||||
if(typeof tempheight!="undefined"){
|
||||
if(tempheight.charAt(tempheight.length-1)=='%')
|
||||
tempheight=(rgmaskHeight*parseInt(tempheight.substr(0,tempheight.length)))/100;
|
||||
if(tempheight>maxheight)
|
||||
tempheight=maxheight;
|
||||
}else{tempheight="auto";}
|
||||
|
||||
if(typeof tempwidth!="undefined"){
|
||||
if(tempwidth.charAt(tempwidth.length-1)=='%')
|
||||
tempwidth=(rgmaskWidth*parseInt(tempwidth.substr(0,tempwidth.length)))/100;
|
||||
if(tempwidth>maxwidth)
|
||||
tempwidth=maxwidth;
|
||||
}else{tempwidth="auto";};
|
||||
$rss("body").append("<div id='rgwindow_temp_div'></div>");
|
||||
|
||||
if(typeof settings.loadDiv!="undefined"){
|
||||
dhtml = $rss("#"+settings.loadDiv).html();
|
||||
$rss("#rgwindow_temp_div").html(dhtml).hide();
|
||||
prepareWindow();
|
||||
}
|
||||
if(typeof settings.loadHtml!="undefined"){
|
||||
dhtml = settings.loadHtml;
|
||||
$rss("#rgwindow_temp_div").html(dhtml).hide();
|
||||
prepareWindow();
|
||||
}
|
||||
if(typeof settings.loadPage!="undefined"){
|
||||
$rss("#rgwindow_temp_div").load(settings.loadPage,function(){$rss(this).hide();dhtml=$rss(this).html();prepareWindow();});
|
||||
}
|
||||
function prepareWindow(){
|
||||
if(tempheight!="auto")
|
||||
rgWTop = (rgmaskHeight-tempheight)/2;
|
||||
else{
|
||||
tempheight=$rss("#rgwindow_temp_div").height();
|
||||
if(tempheight>maxheight)
|
||||
tempheight=maxheight;
|
||||
rgWTop=(rgmaskHeight-tempheight)/2;
|
||||
}
|
||||
if(tempwidth!="auto")
|
||||
rgWLeft = (rgmaskWidth-tempwidth)/2;
|
||||
else{
|
||||
tempwidth=$rss("#rgwindow_temp_div").width();
|
||||
if(tempwidth>maxwidth)
|
||||
tempwidth=maxwidth;
|
||||
rgWLeft=(rgmaskWidth-tempwidth)/2;
|
||||
}
|
||||
tempwidth+=25;
|
||||
$rss("#rgContent").empty();
|
||||
$rss("#rgWindow").animate({"width":tempwidth+"px","height":tempheight+"px",top:rgWTop+"px", left:rgWLeft+"px"},500,function(){$rss("#rgContent").css("height",tempheight+"px").html(dhtml)});
|
||||
$rss("#rgwindow_temp_div").remove();
|
||||
}
|
||||
},
|
||||
modalWindowClose : function(callbackFn){
|
||||
if($rss("#rgWindow").length>0){
|
||||
$rss("#rgWindow").empty();
|
||||
|
||||
Reference in new issue
Block a user