New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
tinyMCE doesn't init inside a jsPanel #51
Comments
Hi there, $.jsPanel({
id: "mypanel",
size: {width: 650, height: 212},
content: '<form method="post"><textarea id="mytinymce">Hi there !</textarea></form>',
callback: function(){
tinymce.init({
selector: '#mytinymce'
});
}
});
// add "jspanelbeforeclose" handler to remove the tinyMCE instance when closing the panel
$(document).on('jspanelbeforeclose', function(event, id){
if( id === "mypanel") {
tinymce.remove('#mytinymce');
}
}); Concerning content you can use any jQuery method/selectors you want to do that if you prefer it that way. Here're a few examples on how to use the jsPanel content property together with jQuery methods |
Thanks a lot for the answer. Everything works. I figured out I had an id conflict. |
@thecenz1 BTW: I'm just working on a few new options like option.onbeforeclose. So you could write: $.jsPanel({
onbeforeclose: function(){
// do something just before the panel closes ...
// if function returns false closing of the panel would be canceled
}
}); That'll be a lot easier than the current handling of events. I think I can release a version 2.6.0 sometime next week. |
Thanks a lot for the tip^^. |
Hey, me again :) Actually the tinyMCE init, but if you minimize the jspanel, then maximize it, focus inside tinyMCE is not anymore allowed and the content previously entered has disappeared. I have made a clean test file to see if the issue could come from my project but I still have the issue. From what I see it only affects the tinyMCE content box, not the toolbar. The content box is an iframe as you will notice if you try to reproduce the example. Here is how I init everything :
And the function that creates the content :
Really weird :/ any idea? I have also tested by hiding and showing tinymce this way :
But it doesn't even trigger the jspanelmaximized event. I also tried jspanelbeforemaximized without showing tinymce and event is not triggered either. So now what I am wondering is when minimize is triggered, what happens to the jspanel content... is it stored, hidden, destroyed, then recreated on maximize... ? |
Hey dude, welcome back ;) Well, the problem is not your code. It's the way I implemented the minimize feature: Whenever you minimize a jsPanel it is removed from its current container element and appended to a special container at the bottom of the page for the minimized panels. Now when you restore the minimized panel again to its former position its again removed from one container and appended to the original container. In this process the ifame content is reloaded -> anything you entered in the "textarea" before is gone.... so far the short explanation. The easy solution: Please take a look at http://beta.jspanel.de/ and let me know whether this could be a solution for you. Bonne soirée, Stefan |
Thanks, indeed that would be a solution. I've installed it but got some issues. I'm closing this topic and reporting the issue in the correct section so it can be useful to others. EDIT: tinyMCE works like a charm on v3. |
Hi,
I successfully put content in my jsPanel (a textarea for example). I am trying to transform my textarea into a tinyMCE rich text editor. I specify a callback fundtion to my jsPanel and try to init a tinyMCE. Init works, but it still displays a textarea instead of the tinyMCE editor...
Any idea why ? Is there any display refresh to perform once a jsPanel is instanciated?Can we manipulate content via normal jQuery selectors or should we always use the methods like content, etc... ?
The text was updated successfully, but these errors were encountered: