Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Javascript not working on 2.0? #48

Closed
trisignia opened this issue Feb 6, 2012 · 9 comments
Closed

Javascript not working on 2.0? #48

trisignia opened this issue Feb 6, 2012 · 9 comments

Comments

@trisignia
Copy link

I'm using the Bootstrap 2.0 branch in my Rails app, but I've found that the javascript components (specifically the dropdown) aren't working. If I include the js directly from the Twitter lib (http://twitter.github.com/bootstrap/assets/js/bootstrap-dropdown.js), then dropdowns work fine.

Has anybody else encountered this problem?

@thomas-mcdonald
Copy link
Member

norepro here, I've just got it working in my application.

I would point out that the API changed slightly for dropdowns, but if it works when you directly include it then I'm not sure where the problem is.

@ghost
Copy link

ghost commented Feb 6, 2012

Possibly related: after updating bootstrap-sass from 1.4.3 to 2.0.0, I'm getting:

couldn't find file 'bootstrap-alerts'
(in /Volumes/Macintosh HD/Data/Dropbox/railswork/marqer/app/assets/javascripts/application.js:12)

The referenced line is

//= require bootstrap-alerts

@ghost
Copy link

ghost commented Feb 6, 2012

Never mind. Twitter changed from bootstrap-alerts to bootstrap-alert. A foolish consistency...

@barriault
Copy link

Try this in application.js

//= require jquery
//= require jquery_ujs
//= require bootstrap

I was having the same problem until I moved the //= require bootstrap statement AFTER the //= require jquery_ujs statement.

@thomas-mcdonald
Copy link
Member

@barriault twitter/bootstrap? Are you pulling in an additional library? bootstrap-sass doesn't have anything namespaced under twitter.

@barriault
Copy link

@thomas-mcdonald Sorry, I've been playing with both the bootstrap-sass and the bootstrap-sass-rails gems. But I was having the same problem in both my test applications until I moved the require AFTER the jQuery stuff.

@thomas-mcdonald
Copy link
Member

The Twitter components depend upon the presence of jQuery, although they shouldn't need the UJS helper.

@trisignia
Copy link
Author

Thanks for the responses. Changing the require order fixes this for me.

@hansy
Copy link

hansy commented May 19, 2012

I'm actually randomly running into this issue after everything working perfectly for so long.

The Dropdown JS suddenly does not work for me. Everything else works fine. I suspect there's some sort of JS clash somewhere, but I'm not sure where.

I think the problem started after moving the gem out of the :asset group because I was having trouble deploying to Heroku.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants