mirror of
https://github.com/silverstripe/silverstripe-reports
synced 2024-10-22 11:05:53 +02:00
a42fd1d2d2
(merged from branches/gsoc) git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/trunk@42008 467b73ca-7a2a-4603-9d3b-597d59a354a9
28 lines
973 B
JavaScript
28 lines
973 B
JavaScript
var ImageEditorActivator = {
|
|
initialize: function() {
|
|
this.onOpen = ImageEditorActivator.onOpen.bind(this);
|
|
},
|
|
|
|
onOpen: 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');
|
|
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 = windowWidth - 30 + 'px';
|
|
iframe.style.height = windowHeight + 10 + 'px';
|
|
iframe.style.zIndex = "1000";
|
|
iframe.style.position = "absolute";
|
|
iframe.style.top = "-2%";
|
|
iframe.style.left = "1.5%";
|
|
window.top.document.body.appendChild(iframe);
|
|
|
|
|
|
}
|
|
|
|
} |