mreq

…a blog about ubuntu, sublime text and the web

If you are in need of a global callback for bootstrap modals, you can use the fired events.

Simply add the following jQuery in coffeescript:

# coffee
$('body').on 'show', '> .modal', ->
  console.log 'Modal is being shown.'

or plain javascript:

// js
$('body').on('show', '> .modal', function() {
  console.log('Modal is being shown.');
});

Note the > selector, which saves a lot of DOM traversing.