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
WYSIHTML5 doesn't work in a bootstrap modal #268
Comments
Hey there, |
👍 I have the same issue. I'll try to figure out what is the problem |
I managed to get it to work Default.html button with id modal_ajax_demo_btn div with id ajax-modal script src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js" script src="../Scripts/lib/bootstrap.min.js" script src="../Scripts/lib/bootstrap-modalmanager.js" script src="../Scripts/lib/bootstrap-modal.js" script src="../Scripts/lib/wysihtml5-0.3.0.js" script src="../Scripts/lib/bootstrap-wysihtml5.js" script src="../Scripts/lib/ui-modals-compose.js" script UIModals.init(); ui-modals-compose.js var UIModals = function () { var initModals = function () { $.fn.modalmanager.defaults.resize = true; $.fn.modalmanager.defaults.spinner = ''; var $modal = $('#ajax-modal'); $('#modal_ajax_demo_btn').on('click', function(){ // create the backdrop and wait for next modal to be triggered $('body').modalmanager('loading'); setTimeout(function(){ $modal.load('inbox_compose.html', '', function () { $modal.modal(); // call Wysihtml5 here initWysihtml5(); }); }, 1000); }); } var initWysihtml5 = function () { $('.inbox-wysihtml5').wysihtml5({ "stylesheets": ["../Content/css/wysiwyg-color.css"] }); } return { //main function to initiate the module init: function () { initModals(); } }; }(); hope it helps |
Not working for me too. |
wysiwyg editor does not works in bootstrap modal because it triggers before creating modal.. or something. so the best way to do it is triggering the modal before wysiwyg editor. so the code should be cant post the js via comment. its runing the code. so i am sharing the link i found this trick. |
Even not working for me . I am using Jquery dialog . I am getting editor in Dialog(popup), but i can't enter text in text area |
check this code above. |
Here is my Ajax code. Still i can't enter data in textarea. Please correct the code if i am wrong |
Here is a example of how to use wysihtml5 editor in bootstraps modal.. hope it helps... |
|
We got bootstrap-wysihtml5 to work with bootstrap 2.3.1 modal.The key is to make sure that the editor is set up on the show event of the modal not on document ready. |
Confirmed what @ndogaru said. This is the code I used to get it working:
Edit: Actually, the above code causes the wysiwyg toolbar to duplicate every time the modal is opened. Haven't figured out a way to prevent that yet. |
Got it! Woo! This issue can now be resolved. You have to remove the iFrame and toolbar whenever the modal is hidden and re-show the textarea so that on each subsequent modal display, the wysithml5 function starts all over again. This is what I did:
|
You can also use this : $('#modal').on('shown.bs.modal', function () { $('#textarea-id').wysihtml5(); } |
So I've been trying to get this plugin to work with jschr's Bootstrap Modal (https://github.com/jschr) but it just doesn't want to cooperate. The files I'm calling in the header look like this:
I've tried putting the bootstrap-wysihtml5.js file before the modalmanager as well, but it made no difference.
What's happening is that the iframe's body isn't getting the correct js passed to it (from what I can tell). As a result, the editing area is uneditable and the toolbar is able to modify and affect everything on the page (including the content in the background).
The body tag inside of the iframe is empty and just shows this:
Any help on this would be greatly appreciated.
The text was updated successfully, but these errors were encountered: