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) {
|
2007-09-16 03:30:43 +02:00
|
|
|
resize.imageContainerResize.disable();
|
|
|
|
crop.disable();
|
|
|
|
imageHistory.disable();
|
|
|
|
imageTransformation.rotate(90,Effects.rotateCallback.bind(this));
|
|
|
|
this.isRotateEnabled = false;
|
2007-09-15 03:31:31 +02:00
|
|
|
}
|
|
|
|
},
|
|
|
|
|
|
|
|
rotateCallback: function() {
|
2007-09-15 22:54:37 +02:00
|
|
|
resize.imageContainerResize.placeClickBox();
|
2007-09-15 03:31:31 +02:00
|
|
|
this.isRotateEnabled = true;
|
2007-09-15 03:08:25 +02:00
|
|
|
},
|
|
|
|
|
|
|
|
setListeners: function() {
|
2007-09-16 04:23:10 +02:00
|
|
|
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
|
|
|
}
|