Sha256: cb5c1f062737bec0207b7757c4d852054521c943ba0ba365589b179df283f84a

Contents?: true

Size: 605 Bytes

Versions: 3

Compression:

Stored size: 605 Bytes

Contents

ready = ->
  
  # If an in-place-edit field contains a link when rendered,
  # a click on the link should follow the link rather than trigger
  # editing.
  # 
  $('.best_in_place * a').on('click', (e)->
    e.stopPropagation()
  )
  $('.best_in_place').on('click', 'a', (e)->
    e.stopPropagation()
  )
  
  # Do not follow links, when editing the link in an input field.
  #
  $('a .best_in_place * input').on('click', (e)->
    e.stopPropagation()
    return false
  )
  $(document).on('click', 'a .best_in_place * input', (e)->
    e.stopPropagation()
    return false
  )
  
$(document).ready(ready)

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
your_platform-1.0.1 app/assets/javascripts/your_platform/best_in_place_hyperlinks.js.coffee
your_platform-1.0.0 app/assets/javascripts/your_platform/best_in_place_hyperlinks.js.coffee
your_platform-0.0.2 app/assets/javascripts/your_platform/best_in_place_hyperlinks.js.coffee