I can’t figure out how to load content into a Bootstrap dropdown menu when it is opened.
I cant even get it to log something when the trigger is clicked.
<span class="dropdown">
<a class="btn btn-mini btn-info dropdown-toggle insert-gallery" id="dLabel" role="button" data-media-id="50" data-toggle="dropdown" href="#">
Add To Gallery
<b class="caret"></b>
</a>
<ul class="dropdown-menu" role="menu" aria-labelledby="dLabel"></ul>
</span>
$('.insert-gallery').on('click', function(){
var media_id = $(this).data('media-id');
console.log(media_id);
console.log('click');
});
Console doesn’t log anything…
Here’s a hacked version of the drop down plugin that posts to the href and posts inline data attributes in the request.
http://pastebin.com/fRWJaL6L