Reputation: 17352
I want to display a textarea-element with bootbox. This textarea should be used with a WYSIWYG-editor, which will be initialized by
$('#editor').redactor();
So I want to add this in the moment the textarea is displayed. I tried this:
bootbox.dialog({
title: "Title",
message: '<textarea id="editor"></textarea>',
init: function () {
$('#editor').redactor();
}
});
But this seems to be wrong.
Upvotes: 2
Views: 3515
Reputation: 1657
Just add a show event:
var box = bootbox.dialog({
title: "Title",
message: '<textarea id="editor"></textarea>'
});
box.bind('shown.bs.modal', function(){
$("#editor").redactor();
});
Upvotes: 7