Browse Source

[svn r22053] FS#2867 - The FCKEditor, the simple file manager: Testing a suggestion by martinkou (the FCKEditor team), see http://dev.fckeditor.net/ticket/3925 .

Ivan Tcholakov 15 years ago
parent
commit
bce5e7a0fa

+ 10 - 3
main/inc/lib/fckeditor/editor/filemanager/browser/default/frmresourceslist.html

@@ -98,11 +98,18 @@ function OpenFile( fileUrl )
 		window.parent.close() ;
 		window.parent.opener.focus() ;
 	}
-	else if ( window.parent.parent )
+	else if ( window.parent.parent && typeof (window.parent.parent.ParentDialog) == 'function' )
 	{
 		// The file manager is inside a dialog.
-		window.parent.parent.Args().ParentWindow.SetUrl( encodeURI( fileUrl ).replace( /#/g, '%23' ) ) ;
-		window.parent.parent.Args().ParentWindow.focus() ;
+
+		// See http://dev.fckeditor.net/ticket/3925
+
+		// Accessing the function SetUrl() : A proposed way by Ivan Tcholakov, 10-JUL-2009.
+		//window.parent.parent.Args().ParentWindow.SetUrl( encodeURI( fileUrl ).replace( /#/g, '%23' ) ) ;
+
+		// Accessing the function SetUrl() : A proposed way by martinkou (the FCKEditor team), 14-JUL-2009.
+		window.parent.parent.ParentDialog().contentWindow.frames['frmMain'].SetUrl( encodeURI( fileUrl ).replace( /#/g, '%23' ) ) ;
+
 		window.parent.parent.CloseDialog() ;
 	}
 	return true ;