How to enable «Alert messages» in the Twitter's Bootstrap theme?

Comments

NecroHill’s picture

I have noticed a typo in the twitter_bootstrap.info :
scripts[] = bootstrap/js/bootstrap-alerts.js
instead of
scripts[] = bootstrap/js/bootstrap-alert.js
but fixing this does not help :( the theme is under heavy development and pretty raw and I look forward to seing it stable

Docc’s picture

Status: Active » Closed (fixed)

Good catch. Fixed in http://drupalcode.org/project/twitter_bootstrap.git/commit/09d644e
Also added the dismiss function to drupal messages.

Stan.Ezersky’s picture

I have in code:

<script type="text/javascript" src="http://drupal7.loc/sites/all/themes/twitter_bootstrap/bootstrap/js/bootstrap-alert.js?lz6a53"></script>
It's valid

and

<div class="alert alert-block alert-status">
  <a href="#" data-dismiss="alert" class="close">×</a>
  <h4 class="alert-heading">Status</h4>
  Some text
</div>

Original code from http://twitter.github.com/bootstrap/javascript.html#alerts

<div class="alert fade in">
  <a href="#" data-dismiss="alert" class="close">×</a>
  <strong>Holy guacamole!</strong> Best check yo self, you're not looking too good.
</div>

I have tried paste «fade in» attribute like this

<div class="alert alert-block alert-status fade in">
  <a href="#" data-dismiss="alert" class="close">×</a>
  <h4 class="alert-heading">Status</h4>
  Some text
</div>

but «Close link» doesn't work.

Docc’s picture

Do the drupal messages close?
Any js errors?

NecroHill’s picture

messages do close but there are some js errors:
No elements were found with the selector: "#"
@http://www.engine.co.ww/sites/all/themes/twitter_bootstrap/bootstrap/js/...
and
trigger(close) called incorrectly
(bootstrap-alert.js line 48)

NecroHill’s picture

Status: Closed (fixed) » Active
Stan.Ezersky’s picture

It works now, thanks!

NecroHill’s picture

weird issue: close [x] link works on inner pages but does not on front page...

Docc’s picture

Then you probaply have a JS conflict. Check for any JS errors or missing JS files.

frankbaele’s picture

Status: Active » Closed (cannot reproduce)
andregriffin’s picture

Project: Twitter's Bootstrap » Bootstrap