-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Integration with elRTE 1.x
DavidJapan edited this page Mar 27, 2013
·
17 revisions
$('selector').elrte({
fmOpen : function(callback) {
$('<div />').dialogelfinder({
url: 'php/connector.php',
commandsOptions: {
getfile: {
oncomplete: 'destroy' // destroy elFinder after file selection
}
},
getFileCallback: callback // pass callback to file manager
});
}
});
var dialog;
$('selector').elrte({
fmOpen: function(callback) {
if (!dialog) {
// create new elFinder
dialog = $('<div />').dialogelfinder({
url: 'connectors/php/connector.php',
commandsOptions: {
getfile: {
oncomplete : 'close' // close/hide elFinder
}
},
getFileCallback: callback // pass callback to file manager
});
} else {
// reopen elFinder
dialog.dialogelfinder('open')
}
}
});
http://elrte.org/redmine/boards/2/topics/3210?r=3232#message-3232
instead of
getFileCallback: callback
write this:
getFileCallback: function(file) { callback(file.path); }
getFileCallback: function(file) { callback(file.url); }