2007-09-15 03:08:25 +02:00
|
|
|
/**
|
|
|
|
* @author Mateusz
|
|
|
|
*/
|
|
|
|
var Effects = {
|
|
|
|
initialize: function() {
|
|
|
|
this.setListeners = Effects.setListeners.bind(this);
|
|
|
|
this.rotate = Effects.rotate.bind(this);
|
2007-09-15 03:31:31 +02:00
|
|
|
this.setListeners();
|
|
|
|
this.isRotateEnabled = true;
|
|
|
|
this.enableRotate = Effects.enableRotate.bind(this);
|
|
|
|
this.disableRotate = Effects.disableRotate.bind(this);
|
2007-09-15 03:08:25 +02:00
|
|
|
},
|
|
|
|
|
|
|
|
rotate: function() {
|
2007-09-15 03:31:31 +02:00
|
|
|
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;
|
2007-09-15 03:08:25 +02:00
|
|
|
},
|
|
|
|
|
|
|
|
setListeners: function() {
|
|
|
|
Event.observe('rotateButton','click',this.rotate);
|
2007-09-15 03:31:31 +02:00
|
|
|
},
|
|
|
|
|
|
|
|
disableRotate: function() {
|
|
|
|
this.isRotateEnabled = false;
|
|
|
|
},
|
|
|
|
|
|
|
|
enableRotate: function() {
|
|
|
|
this.isRotateEnabled = true;
|
|
|
|
}
|
|
|
|
|
2007-09-15 03:08:25 +02:00
|
|
|
}
|