Sha256: 23bd54b7350f2547f2c01566e15cf3dacdc71e4e6280e1fe1569cf821f234501

Contents?: true

Size: 538 Bytes

Versions: 12

Compression:

Stored size: 538 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.54.0 lib/assets/javascripts/unpoly/rails.coffee
unpoly-rails-0.53.4 lib/assets/javascripts/unpoly/rails.coffee
unpoly-rails-0.53.3 lib/assets/javascripts/unpoly/rails.coffee
unpoly-rails-0.53.2 lib/assets/javascripts/unpoly/rails.coffee
unpoly-rails-0.53.1 lib/assets/javascripts/unpoly/rails.coffee
unpoly-rails-0.53.0 lib/assets/javascripts/unpoly/rails.coffee
unpoly-rails-0.52.0 lib/assets/javascripts/unpoly/rails.coffee
unpoly-rails-0.51.1 lib/assets/javascripts/unpoly/rails.coffee
unpoly-rails-0.51.0 lib/assets/javascripts/unpoly/rails.coffee
unpoly-rails-0.50.2 lib/assets/javascripts/unpoly/rails.coffee
unpoly-rails-0.50.1 lib/assets/javascripts/unpoly/rails.coffee
unpoly-rails-0.50.0 lib/assets/javascripts/unpoly/rails.coffee