silverstripe-reports/javascript/ImageEditor/DocumentBody.js
Ingo Schommer 030b55d750 mujma: ENHANCEMENTS: Added new design for ImageEditor?.
(merged from branches/gsoc)


git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/trunk@42046 467b73ca-7a2a-4603-9d3b-597d59a354a9
2007-09-16 02:23:10 +00:00

35 lines
1.5 KiB
JavaScript

/**
* @author Mateusz
*/
var DocumentBody = {
initialize: function() {
this.placeUI = DocumentBody.placeUI.bind(this);
this.placeUI();
Event.observe(window.top,'resize',DocumentBody.resizeIframe.bind(this));
},
resizeIframe: function(event) {
var windowWidth = Element.getDimensions(window.top.document.body).width;
var windowHeight = Element.getDimensions(window.top.document.body).height;
iframe = window.top.document.getElementById('imageEditorIframe');
iframe.style.width = windowWidth - 6 + 'px';
iframe.style.height = windowHeight + 10 + 'px';
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';
},
onImageEditorScroll: function() {
imageBox.reCenterIndicator();
}
}