Twitter bootstrap stop propagation on dropdown open

Try something like this:

$("div#chart div.btn-group > a.dropdown-toggle").click(function (e) {

            e.isDropDownToggleEvent =true;
})

Then:

$("div.node").click(function (e) {
     if (e.isDropDownToggleEvent != null && e.isDropDownToggleEvent)
         return false;

     return true;      
})

You can also try to put e.preventDefault() or e.stopPropagation(); instead of return false.


I used

$('.multiselect').on('click', function (e) {
    $(this).next('.dropdown-menu').toggle();
    e.stopPropagation();
});

This is similar to @Joe's answer, but a bit more generic


$("#orgchart").jOrgChart({ chartElement: '#chart' });

$("div#chart div.btn-group > a.dropdown-toggle, .dropdown-menu li a").click(function(e) {
    e.stopPropagation();
    $('.dropdown-menu').toggle();
});​

Stop Propagation then toggle. Example


I had to add the drop down menu items to the click handler to keep the behavior constant.