Sha256: 62a98df382bb1a6f6a527298f51f44f9c66a0e4292fd5c3ef328d536bab7b180

Contents?: true

Size: 539 Bytes

Versions: 12

Compression:

Stored size: 539 Bytes

Contents

###**
Play nice with Rails UJS
========================
###

up.rails = (($) ->

  u = up.util

  isRails = ->
    !!$.rails

  u.each ['method', 'confirm'], (feature) ->

    dataAttribute = "data-#{feature}"
    upAttribute = "up-#{feature}"

    up.macro "[#{dataAttribute}]", ($element) ->
      if isRails() && up.link.isFollowable($element)
        replacement = {}
        replacement[upAttribute] = $element.attr(dataAttribute)
        u.setMissingAttrs($element, replacement)
        $element.removeAttr(dataAttribute)

)(jQuery)

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
unpoly-rails-0.57.0 lib/assets/javascripts/unpoly/rails.coffee
unpoly-rails-0.56.7 lib/assets/javascripts/unpoly/rails.coffee
unpoly-rails-0.56.6 lib/assets/javascripts/unpoly/rails.coffee
unpoly-rails-0.56.5 lib/assets/javascripts/unpoly/rails.coffee
unpoly-rails-0.56.4 lib/assets/javascripts/unpoly/rails.coffee
unpoly-rails-0.56.3 lib/assets/javascripts/unpoly/rails.coffee
unpoly-rails-0.56.2 lib/assets/javascripts/unpoly/rails.coffee
unpoly-rails-0.56.1 lib/assets/javascripts/unpoly/rails.coffee
unpoly-rails-0.56.0 lib/assets/javascripts/unpoly/rails.coffee
unpoly-rails-0.55.1 lib/assets/javascripts/unpoly/rails.coffee
unpoly-rails-0.55.0 lib/assets/javascripts/unpoly/rails.coffee
unpoly-rails-0.54.1 lib/assets/javascripts/unpoly/rails.coffee