silverstripe-cms/javascript/ImageEditor/Effects.js
Ingo Schommer 71cb143070 mujma: Added exclusive lock on image operation. Starting each operation block others i.e you cannot rotate image when you are cropping area from it.
(merged from branches/gsoc)


git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/trunk@41901 467b73ca-7a2a-4603-9d3b-597d59a354a9
2007-09-15 01:31:31 +00:00

41 lines
927 B
JavaScript

/**
* @author Mateusz
*/
var Effects = {
initialize: function() {
this.setListeners = Effects.setListeners.bind(this);
this.rotate = Effects.rotate.bind(this);
this.setListeners();
this.isRotateEnabled = true;
this.enableRotate = Effects.enableRotate.bind(this);
this.disableRotate = Effects.disableRotate.bind(this);
},
rotate: function() {
if(this.isRotateEnabled) {
resize.imageContainerResize.disable();
crop.disable();
imageTransformation.rotate(90,Effects.rotateCallback.bind(this));
this.isRotateEnabled = false;
}
},
rotateCallback: function() {
resize.imageContainerResize.enable();
crop.enable();
this.isRotateEnabled = true;
},
setListeners: function() {
Event.observe('rotateButton','click',this.rotate);
},
disableRotate: function() {
this.isRotateEnabled = false;
},
enableRotate: function() {
this.isRotateEnabled = true;
}
}