The Bootbox upgrade process from 1.1.2→2.0.0 is pretty straightforward: this article explains the major changes, discusses some new dependencies and introduces some minor additional functionality.
Naturally, Bootbox now relies on the 2.0 release of
bootstrap.css. Similarly, the 2.0 version of
bootstrap-modal.js is also required, which in turn relies on jQuery 1.7.1. Lastly, in order to maintain the functionality exhibited by older versions of Bootbox
bootstrap-transition.js is required to animate the modals in and out of the screen. So, in rough DOM order:
The only outward change to Bootbox's public API is related to the
class option which can be passed to
bootbox.dialog. The available values for this option have always directly mapped to underlying CSS classes and as such now all require a
btn- prefix. For example, if you passed a class of
danger previously, you now need to pass this as
btn-danger—as this what the class is now called in Twitter's framework:
Of course this value just needs to be a valid class, so if you happen to have one called
danger which styles up a button, you can still use that.
bootstrap-transition.js) it made sense to make dialog animation an option in Bootbox 2.0. Animations are still enabled by default but this can be disabled per dialog as follows:
Overriding this setting for every dialog can be a bit of a pain, so you can alternatively supply a default animation value which will be applied to any dialog created without an explicit
bootbox.animate() can be called at any time, so you can use it programatically if you wish.
The demo page has been given a slight lick of paint and now showcases a couple of additional features including the animation options discussed above. It's still rather simplistic so by all means feel free to fork it!
As always any comments, feedback or bug reports are welcome—likewise any suggestions for future versions of the library are always warmly received (if only to bump it off version 2.0.0!).