2007-09-16 03:30:43 +02:00
|
|
|
/**
|
|
|
|
* @author Mateusz
|
|
|
|
*/
|
|
|
|
var DocumentBody = {
|
|
|
|
initialize: function() {
|
2007-09-16 04:23:10 +02:00
|
|
|
this.placeUI = DocumentBody.placeUI.bind(this);
|
|
|
|
this.placeUI();
|
|
|
|
Event.observe(window.top,'resize',DocumentBody.resizeIframe.bind(this));
|
2007-09-16 03:30:43 +02:00
|
|
|
},
|
|
|
|
|
2007-09-16 04:23:10 +02:00
|
|
|
resizeIframe: function(event) {
|
|
|
|
var windowWidth = Element.getDimensions(window.top.document.body).width;
|
2007-09-16 03:30:43 +02:00
|
|
|
var windowHeight = Element.getDimensions(window.top.document.body).height;
|
|
|
|
iframe = window.top.document.getElementById('imageEditorIframe');
|
2007-09-16 04:23:10 +02:00
|
|
|
iframe.style.width = windowWidth - 6 + 'px';
|
2007-09-16 03:30:43 +02:00
|
|
|
iframe.style.height = windowHeight + 10 + 'px';
|
2007-09-16 04:23:10 +02:00
|
|
|
this.placeUI();
|
|
|
|
},
|
|
|
|
|
|
|
|
placeUI: function() {
|
|
|
|
var iframe = window.top.document.getElementById('imageEditorIframe');
|
|
|
|
$('imageEditorContainer').style.height = Element.getDimensions(iframe).height - Element.getDimensions($('TopRuler')).height - Element.getDimensions($('MenuBar')).height - 32 + 'px';
|
|
|
|
$('imageEditorContainer').style.width = Element.getDimensions(iframe).width - Element.getDimensions($('LeftRuler')).width - 14 + 'px';
|
|
|
|
$('LeftRuler').style.height = $('imageEditorContainer').style.height;
|
|
|
|
$('TopLeft').style.width = Element.getDimensions($('MenuBar')).width -
|
|
|
|
Element.getDimensions($('TopRight')).width + 'px';
|
|
|
|
$('TopRight').style.left = Element.getDimensions($('TopLeft')).width + 'px';
|
|
|
|
|
2007-09-16 03:30:43 +02:00
|
|
|
},
|
|
|
|
|
|
|
|
onImageEditorScroll: function() {
|
|
|
|
imageBox.reCenterIndicator();
|
|
|
|
}
|
|
|
|
}
|