From 0eacd614be6b6d117b74fc9ea6533660d46e2c31 Mon Sep 17 00:00:00 2001 From: ChanMyeong Date: Fri, 1 Feb 2013 09:57:32 +0000 Subject: [PATCH] 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 --- addons/resize_image/js/resize_image.js | 6 +++--- addons/resize_image/js/resize_image.min.js | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/addons/resize_image/js/resize_image.js b/addons/resize_image/js/resize_image.js index 4bf451c3e..77dc3f8d6 100644 --- a/addons/resize_image/js/resize_image.js +++ b/addons/resize_image/js/resize_image.js @@ -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(); }; diff --git a/addons/resize_image/js/resize_image.min.js b/addons/resize_image/js/resize_image.min.js index 87ccf4e0e..9b4d993d5 100644 --- a/addons/resize_image/js/resize_image.min.js +++ b/addons/resize_image/js/resize_image.min.js @@ -1 +1 @@ -(function(c){var d=null;function a(){var g=c(document.body);var h,f,e,j,i;if(!d){d=c("
").attr("id","xe_gallery_screen").css({position:"fixed",display:"none",backgroundColor:"black",zIndex:500,opacity:0.7});h=c("
").attr("id","xe_gallery_controls").css({position:"fixed",display:"none",overflow:"hidden",zIndex:510});j=c('
');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); \ No newline at end of file +(function(c){var d=null;function a(){var g=c(document.body);var h,f,e,j,i;if(!d){d=c("
").attr("id","xe_gallery_screen").css({position:"fixed",display:"none",backgroundColor:"black",zIndex:500,opacity:0.7});h=c("
").attr("id","xe_gallery_controls").css({position:"fixed",display:"none",overflow:"hidden",zIndex:510});j=c('
');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); \ No newline at end of file