bootstrap icon indicating copy to clipboard operation
bootstrap copied to clipboard

Closing Alerts (x) Html

Open SiCoUK opened this issue 14 years ago • 2 comments

Would it not be better for the bootstrap-alert.js to add the close link (x) in an alert using progressive enhancement. Seeing as the alerts can't be closed with the base css it seems odd to:

a) Show the examples in the css element with the close (x) link. http://twitter.github.com/bootstrap/components.html#alerts

b) To have to manually add the close (x) link in the html.

c) The close x (×) is shown in the css example as a × (which when copied doesn't work properly) and on the js example it is html encoded as ×

It seems the javascript plugin could do all this and you still have the close css helper (http://twitter.github.com/bootstrap/components.html#misc) if you need to know how to do it manually. Unless I've missed something?

SiCoUK avatar Feb 04 '12 22:02 SiCoUK

Hmm, I could see us enabling that via js. Let's ask @fat.

mdo avatar Feb 05 '12 06:02 mdo

We're not going to add that to our default alert, but there's nothign stopping from you implementing that. It's like 1 line of code.

$('.alert').prepend('<a class="close" data-dismiss="alert">×</a>')

fat avatar Feb 06 '12 07:02 fat