silverstripe-reports/javascript/ImageEditor/Activator.js
Ingo Schommer 31a9fbee3c mujma: Fixed various browser compatibility problems. Now should work on Safari 3.0.2 /Windows, FF 1.5/2.0 Windows/Linux.
(merged from branches/gsoc)


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

26 lines
777 B
JavaScript

var ImageEditorActivator = {
initialize: function() {
this.onOpen = ImageEditorActivator.onOpen.bind(this);
},
onOpen: function() {
iframe = window.top.document.getElementById('imageEditorIframe');
if(iframe != null) {
iframe.parentNode.removeChild(iframe);
}
iframe = window.top.document.createElement('iframe');
fileToEdit = $('ImageEditorActivator').firstChild.src;
iframe.setAttribute("src","admin/ImageEditor?fileToEdit=" + fileToEdit);
iframe.id = 'imageEditorIframe';
iframe.style.width = "97%";
iframe.style.height = "300%";
iframe.style.zIndex = "1000";
iframe.style.position = "absolute";
iframe.style.top = "-2%";
iframe.style.left = "1.5%";
window.top.document.body.appendChild(iframe);
}
}