mirror of
https://github.com/silverstripe/silverstripe-cms
synced 2024-10-22 08:05:56 +02:00
mujma: BUGFIX: All image resolution should now work correctly.
(merged from branches/gsoc) git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/trunk@41895 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
f436292174
commit
88f0a3c0b1
@ -39,16 +39,16 @@ var ImageToResize = {
|
||||
|
||||
resizeOnFirstLoad: function() {
|
||||
windowWidth = Element.getDimensions($('mainContainer')).width;
|
||||
windowHeight = Element.getDimensions($('mainContainer')).height;
|
||||
windowHeight = Element.getDimensions($('mainContainer')).height - 100;
|
||||
imageWidth = Element.getDimensions(this.image).width;
|
||||
imageHeight= Element.getDimensions(this.image).height;
|
||||
if(imageWidth > windowWidth || imageHeight > windowHeight) {
|
||||
if(imageWidth > windowWidth - 120 || imageHeight > windowHeight - 120) {
|
||||
ratio = imageWidth / imageHeight;
|
||||
if(imageWidth > imageHeight) {
|
||||
newWidth = windowWidth - windowWidth/1.75;
|
||||
newWidth = windowWidth - 120;
|
||||
newHeight = newWidth * (1/ratio);
|
||||
} else {
|
||||
newHeight = windowHeight - windowHeight/1.75;
|
||||
newHeight = windowHeight - 120;
|
||||
newWidth = newHeight * ratio;
|
||||
}
|
||||
this.reportSize(0,0);
|
||||
|
Loading…
Reference in New Issue
Block a user