Move to sane directory structure. Don't make 'cms' the top level of the silverstripe...
[silverstripe-elijah.git] / silverstripe-gsoc / cms / javascript / ImageEditor / Effects.js
blobdcfdbbfcdec18ec55ade4625b00668d0d6491947
1 /**
2  * @author Mateusz
3  */\r
4 var Effects = {
5         initialize: function() {
6                 this.setListeners = Effects.setListeners.bind(this);
7                 this.rotate = Effects.rotate.bind(this);
8                 this.setListeners();
9                 this.isRotateEnabled = true;    
10                 this.enableRotate = Effects.enableRotate.bind(this);
11                 this.disableRotate = Effects.disableRotate.bind(this);\r
12         },
13         
14         rotate: function() {
15                 if(this.isRotateEnabled) {
16                         resize.imageContainerResize.disable();
17                         crop.disable();
18                         imageHistory.disable();
19                         imageTransformation.rotate(90,Effects.rotateCallback.bind(this));
20                         this.isRotateEnabled = false;
21                 }
22         },
23         
24         rotateCallback: function() {
25            resize.imageContainerResize.placeClickBox();
26            this.isRotateEnabled = true;
27         },
28         
29         setListeners: function() {
30                 Event.observe('rotateButton','click',this.rotate);\r
31         },
32         
33         disableRotate: function() {
34            this.isRotateEnabled = false;   
35         },
36         
37         enableRotate: function() {
38             this.isRotateEnabled = true;
39         }
40                 \r