estum / growlyflash

Growl-styled flash messages for Ruby on Rails and Bootstrap
MIT License
58 stars 34 forks source link

Turbolinks - click twice to close #10

Closed kevinjbayer closed 9 years ago

kevinjbayer commented 9 years ago

The title almost says it all. I'm having to click the close button twice in order to get it to close. Tried various ways and nothing is getting it to close on the first click. Using the coffeescript code in README. Is this a known issue or am I just blanking on the solution. Cheers for the great gem!

estum commented 9 years ago

@kevinjbayer Hmm, I can't reproduce your issue. I've tested with Rails 4, jquery-rails 3.1.1, bootstrap-sass 3.1.1, turbolinks 2.4.0 and the latest stable growlyflash.

My application.js.coffee for testing was:

#= require jquery
#= require jquery_ujs
#= require bootstrap
#= require growlyflash/growlyflash
#= require turbolinks

jQuery ->
  $(document).on 'click.alert.data-api', '[data-dismiss="alert"]', (e) -> 
    e.stopPropagation()
    off

  $(document).on 'touchstart click', ".bootstrap-growl", (e) -> 
    e.stopPropagation()
    $('[data-dismiss="alert"]', @).click()
    off

Please, provide versions of the gems (jquery-rails, bootstrap-sass and turbolinks) you are using and userAgent of your browser.