Issue 2898 fixed. Image resizing addon img align problem solved.

git-svn-id: http://xe-core.googlecode.com/svn/branches/maserati@12665 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
ChanMyeong 2013-02-01 09:57:32 +00:00
parent 7e070bf0f7
commit 0eacd614be
2 changed files with 4 additions and 4 deletions

View file

@ -144,11 +144,11 @@ function getScreen() {
var src = this.list.eq(this.index).attr("rawsrc");
if(!src) src = this.list.eq(this.index).attr("src");
imgframe.attr("src", src).css({
left : Math.round( parseInt($(document).scrollLeft()) + (clientWidth-imgframe.width()-14)/2, 0 ) + "px",
top : Math.round( (clientHeight-imgframe.height()-14)/2, 0 ) + "px"
left : clientWidth/2 - imgframe.width()/2 + "px",
top : clientHeight/2 - imgframe.height()/2 + "px"
});
closebtn.css({
left : Math.round( Math.max( parseInt($(document).scrollLeft()) + (clientWidth-closebtn.width())/2, 0 ) ) + "px",
left : clientWidth/2 - 32 + "px",
top : "10px"
}).focus();
};

View file

@ -1 +1 @@
(function(c){var d=null;function a(){var g=c(document.body);var h,f,e,j,i;if(!d){d=c("<div>").attr("id","xe_gallery_screen").css({position:"fixed",display:"none",backgroundColor:"black",zIndex:500,opacity:0.7});h=c("<div>").attr("id","xe_gallery_controls").css({position:"fixed",display:"none",overflow:"hidden",zIndex:510});j=c('<button type="button" id="xe_gallery_prevbtn" />').css({left:"10px",backgroundPosition:"0 -64px"}).click(function(){d.xePrev()}).appendTo(h);e=c('<button type="button" id="xe_gallery_closebtn" />').css({top:"10px",backgroundPosition:"0 0"}).click(function(){d.xeHide()}).appendTo(h);i=c('<button type="button" id="xe_gallery_nextbtn" />').attr("id","xe_gallery_nextbtn").css({right:"10px",backgroundPosition:"0 -128px"}).click(function(){d.xeNext()}).appendTo(h);h.find(">button").css({position:"absolute",width:"64px",height:"64px",zIndex:530,cursor:"pointer",border:0,margin:0,padding:0,backgroundColor:"transparent",backgroundImage:"url("+request_uri+"addons/resize_image/btn.png)",backgroundRepeat:"no-repeat",opacity:".5",filter:"alpha(opacity=50)"}).mouseover(function(){c(this).css({opacity:"1",filter:"alpha(opacity=100)"})}).mouseout(function(){c(this).css({opacity:".5",filter:"alpha(opacity=50)"})}).focus(function(){c(this).trigger("mouseover")}).blur(function(){c(this).trigger("mouseout")});f=c("<img>").attr("id","xe_gallery_holder").css({border:"5px solid white",zindex:520,maxWidth:"none",borderRadius:"5px",boxShadow:"0 0 10px #000"}).appendTo(h).draggable();g.append(d).append(h);d.xeShow=function(){var l=c(window).width();var k=c(window).height();c("#xe_gallery_controls,#xe_gallery_screen").show().css({top:0,right:0,bottom:0,left:0});c("#xe_gallery_prevbtn,#xe_gallery_nextbtn").css("top",Math.round(k/2-32)+"px");this.xeMove(0)};d.xeHide=function(k){d.hide();h.hide()};d.xePrev=function(){this.xeMove(-1)};d.xeNext=function(){this.xeMove(1)};d.xeMove=function(n){var m=c(window).width();var k=c(window).height();this.index+=n;j.css("visibility",(this.index>0)?"visible":"hidden");i.css("visibility",(this.index<this.list.size()-1)?"visible":"hidden");var l=this.list.eq(this.index).attr("rawsrc");if(!l){l=this.list.eq(this.index).attr("src")}f.attr("src",l).css({left:Math.round(parseInt(c(document).scrollLeft())+(m-f.width()-14)/2,0)+"px",top:Math.round((k-f.height()-14)/2,0)+"px"});e.css({left:Math.round(Math.max(parseInt(c(document).scrollLeft())+(m-e.width())/2,0))+"px",top:"10px"}).focus()};c(document).keydown(function(k){if(k.which==27){d.xeHide();return false}else{return true}})}else{h=c("#xe_gallery_controls");f=c("#xe_gallery_holder");e=c("#xe_gallery_closebtn");j=c("#xe_gallery_prevbtn");i=c("#xe_gallery_nextbtn")}return d}function b(h){var f=c(this).closest(".xe_content");var e=f.find("img[rel=xe_gallery]");var g=c.inArray(c(this).get(0),e.get());var i=a();i.list=e;i.index=g;i.xeShow()}c(window).load(function(){var g=/(?:(modules|addons|classes|common|layouts|libs|widgets|widgetstyles)\/)/i;var f=/(?:common\/tpl\/images\/blank\.gif$)/i;var h=c('<div style="height:1px;overflow:hidden;opacity:0;display:block;clear:both"></div>');function e(k,m){if(!m){m=0}if(m>=10){return}var l=this;var j={width:l.width(),height:l.height()};if(!j.width||!j.height){setTimeout(function(){e.call(l,k,++m)},200);return}if(j.width<=k){return}var i=k/j.width;l.removeAttr("width").removeAttr("height").css({width:k,height:parseInt(j.height*i,10)})}c(".xe_content").each(function(){var i=h.appendTo(this).width();h.remove();if(!i){return}c("img",this).each(function(){var j=c(this);var k=j.attr("src");if(g.test(k)&&!f.test(k)){return}j.attr("rel","xe_gallery");e.call(j,i)});c("img[rel=xe_gallery]",this).live("mouseover",function(){var j=c(this);if(!j.parent("a").length&&!j.attr("onclick")){j.css("cursor","pointer").click(b)}})})})})(jQuery);
(function(c){var d=null;function a(){var g=c(document.body);var h,f,e,j,i;if(!d){d=c("<div>").attr("id","xe_gallery_screen").css({position:"fixed",display:"none",backgroundColor:"black",zIndex:500,opacity:0.7});h=c("<div>").attr("id","xe_gallery_controls").css({position:"fixed",display:"none",overflow:"hidden",zIndex:510});j=c('<button type="button" id="xe_gallery_prevbtn" />').css({left:"10px",backgroundPosition:"0 -64px"}).click(function(){d.xePrev()}).appendTo(h);e=c('<button type="button" id="xe_gallery_closebtn" />').css({top:"10px",backgroundPosition:"0 0"}).click(function(){d.xeHide()}).appendTo(h);i=c('<button type="button" id="xe_gallery_nextbtn" />').attr("id","xe_gallery_nextbtn").css({right:"10px",backgroundPosition:"0 -128px"}).click(function(){d.xeNext()}).appendTo(h);h.find(">button").css({position:"absolute",width:"64px",height:"64px",zIndex:530,cursor:"pointer",border:0,margin:0,padding:0,backgroundColor:"transparent",backgroundImage:"url("+request_uri+"addons/resize_image/btn.png)",backgroundRepeat:"no-repeat",opacity:".5",filter:"alpha(opacity=50)"}).mouseover(function(){c(this).css({opacity:"1",filter:"alpha(opacity=100)"})}).mouseout(function(){c(this).css({opacity:".5",filter:"alpha(opacity=50)"})}).focus(function(){c(this).trigger("mouseover")}).blur(function(){c(this).trigger("mouseout")});f=c("<img>").attr("id","xe_gallery_holder").css({border:"5px solid white",zindex:520,maxWidth:"none",borderRadius:"5px",boxShadow:"0 0 10px #000"}).appendTo(h).draggable();g.append(d).append(h);d.xeShow=function(){var l=c(window).width();var k=c(window).height();c("#xe_gallery_controls,#xe_gallery_screen").show().css({top:0,right:0,bottom:0,left:0});c("#xe_gallery_prevbtn,#xe_gallery_nextbtn").css("top",Math.round(k/2-32)+"px");this.xeMove(0)};d.xeHide=function(k){d.hide();h.hide()};d.xePrev=function(){this.xeMove(-1)};d.xeNext=function(){this.xeMove(1)};d.xeMove=function(n){var m=c(window).width();var k=c(window).height();this.index+=n;j.css("visibility",(this.index>0)?"visible":"hidden");i.css("visibility",(this.index<this.list.size()-1)?"visible":"hidden");var l=this.list.eq(this.index).attr("rawsrc");if(!l){l=this.list.eq(this.index).attr("src")}f.attr("src",l).css({left:m/2-f.width()/2+"px",top:k/2-f.height()/2+"px"});e.css({left:m/2-32+"px",top:"10px"}).focus()};c(document).keydown(function(k){if(k.which==27){d.xeHide();return false}else{return true}})}else{h=c("#xe_gallery_controls");f=c("#xe_gallery_holder");e=c("#xe_gallery_closebtn");j=c("#xe_gallery_prevbtn");i=c("#xe_gallery_nextbtn")}return d}function b(h){var f=c(this).closest(".xe_content");var e=f.find("img[rel=xe_gallery]");var g=c.inArray(c(this).get(0),e.get());var i=a();i.list=e;i.index=g;i.xeShow()}c(window).load(function(){var g=/(?:(modules|addons|classes|common|layouts|libs|widgets|widgetstyles)\/)/i;var f=/(?:common\/tpl\/images\/blank\.gif$)/i;var h=c('<div style="height:1px;overflow:hidden;opacity:0;display:block;clear:both"></div>');function e(k,m){if(!m){m=0}if(m>=10){return}var l=this;var j={width:l.width(),height:l.height()};if(!j.width||!j.height){setTimeout(function(){e.call(l,k,++m)},200);return}if(j.width<=k){return}var i=k/j.width;l.removeAttr("width").removeAttr("height").css({width:k,height:parseInt(j.height*i,10)})}c(".xe_content").each(function(){var i=h.appendTo(this).width();h.remove();if(!i){return}c("img",this).each(function(){var j=c(this);var k=j.attr("src");if(g.test(k)&&!f.test(k)){return}j.attr("rel","xe_gallery");e.call(j,i)});c("img[rel=xe_gallery]",this).live("mouseover",function(){var j=c(this);if(!j.parent("a").length&&!j.attr("onclick")){j.css("cursor","pointer").click(b)}})})})})(jQuery);