Friday, 22 June 2012

Grails - Twitter Bootstrap with the resources plugin stops working

I was mucking around last night with the intention of making my resources load more efficiently, and all of a sudden my Twitter Bootstrap enabled  drop downs are no longer working. This was what I had in my declaration initially (after I was mucking around):



 modules = { 

      core { 

           dependsOn 'jquery, jquery-ui, jquery-theme, bootstrap, utils'  

           resource url: '/js/spin.js', disposition: 'head' 

           resource url: '/js/jquery.spin.js', disposition: 'head' 

           resource url: '/js/bootstrap.min.js', disposition: 'head' 

      } 

}


It turned out that was a really bad mistake, as the bootstrap module already declares a bootstrap.js. By re declaring the dependency elsewhere, you get into weirdness with some of the bootstrap plugins not working the way it should, in my case the dropdowns.




2 comments:

  1. Thanks for this note - I had the same problem and it took me a while to find your page. I had a variation of this problem, but sure as hell it was the issue. Thanks!

    ReplyDelete