Sha256: 1e5978563830f3b28c11239d566094053c83e6c271c2f458fc47bc0f6e626c7d
Contents?: true
Size: 781 Bytes
Versions: 40
Compression:
Stored size: 781 Bytes
Contents
###* Play nice with Rails UJS ======================== ### up.rails = (($) -> u = up.util willHandle = ($element) -> $element.is('[up-follow], [up-target], [up-modal], [up-popup]') isRails = -> u.isGiven($.rails) u.each ['method', 'confirm'], (feature) -> dataAttribute = "data-#{feature}" upAttribute = "up-#{feature}" up.compiler "[#{dataAttribute}]", ($element) -> if isRails() && willHandle($element) replacement = {} replacement[upAttribute] = $element.attr(dataAttribute) u.setMissingAttrs($element, replacement) $element.removeAttr(dataAttribute) csrfField = -> if isRails() name: $.rails.csrfParam() value: $.rails.csrfToken() csrfField: csrfField isRails: isRails )(jQuery)
Version data entries
40 entries across 40 versions & 2 rubygems