In IE & FF, this works:
IE, FF: I can make a button with the "ckfinder-button" class, click it, get a good ckfinder dialog, close the dialog, click another button with the class and get a new ckfinder dialog, etc. Works excellent.
In chrome-release, -dev, -beta and -canary it doesn't work. I get the first dialog, but after that I just get empty iframes. I would really like to buy CKFinder, but I need multiple buttons with multiple dialogs in an AJAX application.
var gCKFinder = new CKFinder(); $(".ckfinder-button").live( 'click', function() { var ckUpdateField = $( "#" + $(this).attr("rel") ); console.log( "click ckfinder ", ckUpdateField ); // gCKFinder.basePath = '/ckfinder/'; // Setting custom width and user language. gCKFinder.width = "100%"; gCKFinder.height = "100%"; gCKFinder.id = Math.floor(Math.random() * 10000); gCKFinder.selectActionFunction = function ( fileUrl, data ) { console.log( fileUrl, data ); ckUpdateField.val( fileUrl ); img = $("<img/>").attr( "src", fileUrl ); ckUpdateField.closest( "div" ).find( ".image-holder" ).html( img ); $(".ckfinder-dialog").dialog( "destroy" ); $(".ckfinder-dialog").remove(); }; var gCKFinderObject = $("<div></div>").appendTo("body").addClass("ckfinder-dialog").attr("id", "ck"+ gCKFinder.id ); gCKFinder.appendTo( gCKFinderObject[0] ); gCKFinderObject.dialog( { modal: true, draggable: false, resizable: false, width: 800, height: 600, closeOnEscape: true, close: function() { $(".ckfinder-dialog").dialog( "destroy" ); $(".ckfinder-dialog").remove(); } } ); } );
IE, FF: I can make a button with the "ckfinder-button" class, click it, get a good ckfinder dialog, close the dialog, click another button with the class and get a new ckfinder dialog, etc. Works excellent.
In chrome-release, -dev, -beta and -canary it doesn't work. I get the first dialog, but after that I just get empty iframes. I would really like to buy CKFinder, but I need multiple buttons with multiple dialogs in an AJAX application.
Re: Bug in CKFinder & Chrome
Looks like the same issue as in the following topic: viewtopic.php?f=10&t=22448
Being able to destroy programatically CKFinder instance would solve this issue.
Wiktor Walc
CTO, CKSource - http://cksource.com
--
Follow CKEditor on: Twitter | Facebook | Google+