refactory-id / bootstrap-markdown

Bootstrap plugin for markdown editing
Apache License 2.0
1.99k stars 371 forks source link

How to toggle modal with additional button? #203

Closed mstnorris closed 8 years ago

mstnorris commented 8 years ago

I'm trying to toggle a modal (that contains a Dropzone element) from an additional button that I've added although when you press the button twice, it appears to disable the editor. The only way to get it back is to refresh the page.

$("#content").markdown({
            additionalButtons: [
                [{
                    name: "groupCustom",
                    data: [{
                        name: "uploadFile",
                        title: "Upload File",
                        icon: "fa fa-upload",
                        callback: function(e){
                            $('#myModal').toggle(); // what is wrong with this line?
                        }
                    }]
                }]
            ]
        });
mstnorris commented 8 years ago

My bad

$('#myModal').toggle();

Should be

$('#myModal').modal('toggle')