Make dialog 'x' buttons work with Bootstrap 2

For #4203.

@gruehle