diff --git a/scripts/filemanager.js b/scripts/filemanager.js index 99a0e864..bc381b54 100644 --- a/scripts/filemanager.js +++ b/scripts/filemanager.js @@ -122,6 +122,8 @@ var setDimensions = function(){ var bheight = 20; if(config.options.searchBox === true) bheight +=33; + + if($.urlParam('CKEditorCleanUpFuncNum')) bheight +=60; var newH = $(window).height() - $('#uploader').height() - bheight; $('#splitter, #filetree, #fileinfo, .vsplitbar').height(newH); @@ -557,7 +559,7 @@ var selectItem = function(data) { var url = relPath + data['Path']; } - if(window.opener || window.tinyMCEPopup || $.urlParam('field_name')){ + if(window.opener || window.tinyMCEPopup || $.urlParam('CKEditorCleanUpFuncNum') || $.urlParam('CKEditor')) { if(window.tinyMCEPopup){ // use TinyMCE > 3.0 integration method var win = tinyMCEPopup.getWindowArg("window"); @@ -587,8 +589,15 @@ var selectItem = function(data) { } else if($.urlParam('CKEditor')){ - // use CKEditor 3.0 integration method - window.opener.CKEDITOR.tools.callFunction($.urlParam('CKEditorFuncNum'), url); + // use CKEditor 3.0 + integration method + if (window.opener) { + // Popup + window.opener.CKEDITOR.tools.callFunction($.urlParam('CKEditorFuncNum'), url); + } else { + // Modal (in iframe) + parent.CKEDITOR.tools.callFunction($.urlParam('CKEditorFuncNum'), url); + parent.CKEDITOR.tools.callFunction($.urlParam('CKEditorCleanUpFuncNum')); + } } else { // use FCKEditor 2.0 integration method if(data['Properties']['Width'] != ''){ @@ -601,7 +610,9 @@ var selectItem = function(data) { } } - window.close(); + if (window.opener) { + window.close(); + } } else { $.prompt(lg.fck_select_integration); } @@ -1183,7 +1194,7 @@ var getFileInfo = function(file) { var template = '