silverstripe-cms/javascript/ImageEditor/DocumentBody.js
Ingo Schommer a42fd1d2d2 mujma: ENHANCEMENTS: Now image is placed in scrolled container so operation that results in image larger than screen are no longer problem.
(merged from branches/gsoc)


git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/trunk@42008 467b73ca-7a2a-4603-9d3b-597d59a354a9
2007-09-16 01:30:43 +00:00

25 lines
938 B
JavaScript

/**
* @author Mateusz
*/
var DocumentBody = {
initialize: function() {
var windowHeight = Element.getDimensions(window.top.document.body).height;
Event.observe(window.top,'resize',DocumentBody.onWindowResize.bind(this));
Event.observe($('imageEditorContainer'),'scroll',DocumentBody.onImageEditorScroll.bind(this));
$('imageEditorContainer').style.height = windowHeight - 109 + 'px';
},
onWindowResize: function() {
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 - 30 + 'px';
iframe.style.height = windowHeight + 10 + 'px';
$('imageEditorContainer').style.height = windowHeight - 105 + 'px';
},
onImageEditorScroll: function() {
imageBox.reCenterIndicator();
}
}