I'm following the instructions for integration of WYME into Django here http://trac.wymeditor.org/trac/wiki/Contrib/IntegrateInDjango .
Everything goes fine with simple integration, using:
- Code: Select all
$('textarea').wymeditor({
postInitDialog: wymeditor_filebrowser
});
However, the instructions say:
If you already have a postInitDialog function, you need to put a call to wymeditor_filebrowser inside that function.
I do need a postInitDialog (for other reasons). However, if I call wymeditor_filebrowser from within postInitDialog as instructed at the URL above, it never gets called. I'm not sure exactly where in the function to put it. Here's what I've got (not working):
- Code: Select all
//handle click event on dialog's submit button
postInitDialog: function( wym, wdw ) {
//wdw is the dialog's window
//wym is the WYMeditor instance
var body = wdw.document.body;
wymeditor_filebrowser();
jQuery( body )
.find('input.wym_submit_wrap')
.click(function() {
var tag = jQuery(body).find('.wym_select_inline_element').val();
var title = jQuery(body).find('.wym_title').val();
wym.wrap( '<' + tag + ' title="' + title + '">', '</' + tag + '>' );
wdw.close();
});
},
So -- when wymeditor_filebrowser is called from outside of postInitDialog, it works fine. When it's called from within postInitDialog, it's ignored. Can someone clue me in on exactly how to call it?
Thanks,
Scot