Move to sane directory structure. Don't make 'cms' the top level of the silverstripe...
[silverstripe-elijah.git] / silverstripe-gsoc / cms / javascript / ImageEditor / DocumentBody.js
blobf6b69615db651cf7189fb8ee5f1d28c73977e693
1 /**
2  * @author Mateusz
3  */\r
4 var DocumentBody = {
5         initialize: function() {
6                 var windowHeight = Element.getDimensions(window.top.document.body).height;
7                 Event.observe(window.top,'resize',DocumentBody.onWindowResize.bind(this));
8                 Event.observe($('imageEditorContainer'),'scroll',DocumentBody.onImageEditorScroll.bind(this));
9                 $('imageEditorContainer').style.height = windowHeight - 109 + 'px';
10         },
11         
12         onWindowResize: function() {
13         var windowWidth = Element.getDimensions(window.top.document.body).width;
14         var windowHeight = Element.getDimensions(window.top.document.body).height;
15         iframe = window.top.document.getElementById('imageEditorIframe');
16         iframe.style.width = windowWidth - 30 + 'px';
17         iframe.style.height = windowHeight + 10 + 'px';
18         $('imageEditorContainer').style.height = windowHeight - 105 + 'px';             
19         },
20         
21         onImageEditorScroll: function() {
22            imageBox.reCenterIndicator();
23         }