From 2c07f001f26a91f46a6c4258a24392ff73b1d03a Mon Sep 17 00:00:00 2001 From: Ingo Schommer Date: Sat, 15 Sep 2007 20:55:50 +0000 Subject: [PATCH] mujma: BUGFIX: From now croping should appear without image flickering. (merged from branches/gsoc) git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/trunk@41932 467b73ca-7a2a-4603-9d3b-597d59a354a9 --- javascript/ImageEditor/Crop.js | 8 +++----- javascript/ImageEditor/Image.js | 3 ++- javascript/ImageEditor/ImageTransformation.js | 2 +- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/javascript/ImageEditor/Crop.js b/javascript/ImageEditor/Crop.js index 8ac167a1..4f522c6f 100644 --- a/javascript/ImageEditor/Crop.js +++ b/javascript/ImageEditor/Crop.js @@ -110,7 +110,6 @@ var Crop = { startLeft = this.cropBox.getLeft() ; if(newWidth > 35 && newHeight > 35) { imageTransformation.crop(startTop,startLeft,newWidth,newHeight,Crop.cropCallback.bind(this)); - imageHistory.enable(); } else { alert('Crop area too small'); } @@ -119,10 +118,9 @@ var Crop = { }, cropCallback: function() { - this.resizeCropBox.placeClickBox(); - effects.enableRotate(); - this.enable(); - + resize.imageContainerResize.placeClickBox(); + resize.imageContainerResize.setVisible(true); + Element.hide(this.cropBox,this.leftGreyBox,this.rightGreyBox,this.upperGreyBox,this.lowerGreyBox,$('cropOk'),$('cropCancel')); }, setListeners: function() { diff --git a/javascript/ImageEditor/Image.js b/javascript/ImageEditor/Image.js index 92b623d0..8a37a346 100644 --- a/javascript/ImageEditor/Image.js +++ b/javascript/ImageEditor/Image.js @@ -37,10 +37,11 @@ var ImageToResize = { resize.imageContainerResize.originalHeight = this.imageToResize.height; resize.imageContainerResize.placeClickBox(); imageBox.checkOutOfDrawingArea($('imageContainer').getWidth(),$('imageContainer').getHeight()); - crop.onImageLoadCallback(); crop.enable(); resize.imageContainerResize.enable(); effects.enableRotate(); + imageHistory.enable(); + crop.onImageLoadCallback(); } this.reportSize(); }, diff --git a/javascript/ImageEditor/ImageTransformation.js b/javascript/ImageEditor/ImageTransformation.js index cc52a5a4..3f935260 100644 --- a/javascript/ImageEditor/ImageTransformation.js +++ b/javascript/ImageEditor/ImageTransformation.js @@ -73,8 +73,8 @@ var ImageTransformation = { $('image').style.height = response.height + 'px'; $('imageContainer').style.width = response.width + 'px'; $('imageContainer').style.height = response.height + 'px'; - imageHistory.add('crop',$('image').src); if(callback != null) callback(); + imageHistory.add('crop',$('image').src); } }; imageBox.showIndicator();