Sha256: 0166275008dd33a1cad2a30f93999d3d61f95dfdd0c2f52a03c2ab5f60f06150

Contents?: true

Size: 1.02 KB

Versions: 30

Compression:

Stored size: 1.02 KB

Contents

#Ajaxify.init
#  flash_types: ['notice', 'warning']
#  base_paths: ['de']

jQuery ->
  $(document).on 'ajaxify:content_loaded', (event, data, status, jqXHR, url) ->
    $nav_links = $('#navigation a')
    $nav_links.removeClass 'active'
    $nav_links.filter( ->
      href = $(this).attr('href')
      (window.location.pathname == href and window.location.hash == '') or   # for browsers with histori api
      window.location.hash.match(new RegExp("^#(#{href}\\?|#{href}$)"))      # for browsers without histori api
    ).addClass 'active'

  flash_timeout = null

  $(document).on 'ajaxify:flash_displayed', (event, flash_type) ->
    clearTimeout flash_timeout if flash_timeout
    flash_timeout = setTimeout( ->
      $("##{flash_type}").fadeOut()
    , 5000)

#  $('body').on 'ajaxify:before_load', (event, url) ->
#    alert "Will load #{url}"
#
#  $('body').on 'ajaxify:content_loaded', (event, data, status, jqXHR, url) ->
#    alert "Content loaded"
#
#  $('body').on 'ajaxify:content_inserted', ->
#    alert "Content inserted"


Version data entries

30 entries across 30 versions & 1 rubygems

Version Path
ajaxify_rails-0.9.7 spec/ajaxify_test/app/assets/javascripts/main.js.coffee
ajaxify_rails-0.9.6 spec/ajaxify_test/app/assets/javascripts/main.js.coffee
ajaxify_rails-0.9.5 spec/ajaxify_test/app/assets/javascripts/main.js.coffee
ajaxify_rails-0.9.4 spec/ajaxify_test/app/assets/javascripts/main.js.coffee
ajaxify_rails-0.9.3 spec/ajaxify_test/app/assets/javascripts/main.js.coffee
ajaxify_rails-0.9.2 spec/ajaxify_test/app/assets/javascripts/main.js.coffee
ajaxify_rails-0.9.1 spec/ajaxify_test/app/assets/javascripts/main.js.coffee
ajaxify_rails-0.9.0 spec/ajaxify_test/app/assets/javascripts/main.js.coffee
ajaxify_rails-0.8.9 spec/ajaxify_test/app/assets/javascripts/main.js.coffee
ajaxify_rails-0.8.8 spec/ajaxify_test/app/assets/javascripts/main.js.coffee
ajaxify_rails-0.8.7 spec/ajaxify_test/app/assets/javascripts/main.js.coffee
ajaxify_rails-0.8.6 spec/ajaxify_test/app/assets/javascripts/main.js.coffee
ajaxify_rails-0.8.5 spec/ajaxify_test/app/assets/javascripts/main.js.coffee
ajaxify_rails-0.8.4 spec/ajaxify_test/app/assets/javascripts/main.js.coffee
ajaxify_rails-0.8.3 spec/ajaxify_test/app/assets/javascripts/main.js.coffee
ajaxify_rails-0.8.2 spec/ajaxify_test/app/assets/javascripts/main.js.coffee
ajaxify_rails-0.8.1 spec/ajaxify_test/app/assets/javascripts/main.js.coffee
ajaxify_rails-0.8.0 spec/ajaxify_test/app/assets/javascripts/main.js.coffee
ajaxify_rails-0.7.8 spec/ajaxify_test/app/assets/javascripts/main.js.coffee
ajaxify_rails-0.7.7 spec/ajaxify_test/app/assets/javascripts/main.js.coffee