Issues with bootstrap plugins #78
Comments
Pull request on bootstrap addressing this: twbs/bootstrap#5308 |
thanks :) |
also, twitter-bootstrap-turbo gem "clone" of twitter-bootstrap-rails with turbo support is available in the interim. It uses a different solution to solving the problem, I actually prefer the pull-request solution over mine, but they both work. |
I see. currently I using twitter-bootstrap-turbo, and it's working well for me... |
Note to future visitor using SCSS via https://github.com/anjlab/bootstrap-rails — I've applied @davydotcom's fix to that project in my fork: https://github.com/ryw/bootstrap-rails |
@yury mentioned jquery.turbolinks as a possible fix to the issue as well. I wonder if turbolinks should detect if app has jQuery, and if so, apply the following code, that wil help with this issue on a multitude of plugins, not just bootstrap. From https://github.com/kossnocorp/jquery.turbolinks/blob/master/src/jquery.turbolinks.coffee $ = require?('jquery') || window.jQuery
# List for store callbacks passed to `$` or `$.ready`
callbacks = []
# Call each callback in list
ready = ->
callback() for callback in callbacks
# Bind `ready` to DOM ready event
$(ready)
# Store callbacks in list on `$` and `$.ready`
$.fn.ready = (callback) ->
callbacks.push(callback)
# Bind `ready` to Tubolinks page change event
$(document).on('page:change', ready) |
That's pretty nice, however maybe out of scope here... One note is he binds to page:change where page:load would be more appropriate Sent from my iPhone On Oct 9, 2012, at 6:45 PM, Ryan Walker notifications@github.com wrote:
|
Man the more I look at jquery.turbolinks, the more I think this is awesome. @dhh, would potentially adding this as another asset in the gem be a good idea? Something like add this to your manifest for jquery support. etc. |
The ONLY, downside I see to kossonocopr jquery.turbolinks solution is that the order in which these js files are included become very important. |
With this solution, the turbolinks JS should always be the last included. Also, I'm not a JS-ninja, but I do believe that it will generate a dependency of jQuery to turbolinks, huh? |
Not if its a seperate js file that you can require in your manifest optionally. |
seems legit. |
Having it as a separate file sounds fine. On Oct 10, 2012, at 1:46, David Estes notifications@github.com wrote:
|
👍 |
Hi, I looking for the best way to do that.. don't know if it could be fixed in turbolinks, in bootstrap, or anywhere...
But, I recently created a question in stackoverflow, and found that's the strange behavior is because the way of modal plugins of bootstrap were implemented.
Maybe it is a possible hack to do with that, to made it work...
The text was updated successfully, but these errors were encountered: