Sha256: 2cd6a3defa6fbd268006c16abeebbeb27cf4d2208f1c0d5f24c9af95a9fff604

Contents?: true

Size: 609 Bytes

Versions: 5

Compression:

Stored size: 609 Bytes

Contents

# Fade out cocoon remove.
$(document).on 'cocoon:before-remove', (event, $obj) ->
  $button = $(event.currentTarget.activeElement)

  confirm = ($button.data('confirm') || '').length > 0
  confirmed = $button.data('confirmed') || false

  if confirm && !confirmed
    event.preventDefault()
  else
    $(event.target).data('remove-timeout', 1000)
    $obj.fadeOut('slow')

# Open all external trix links in a new window.
$(document).on 'click', '.trix-content a', (event) ->
  obj = event.currentTarget

  if obj.host != window.location.host && !obj.isContentEditable
    obj.setAttribute('target', '_blank')

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
effective_bootstrap-0.10.11 app/assets/javascripts/effective_bootstrap/other.js.coffee
effective_bootstrap-0.10.10 app/assets/javascripts/effective_bootstrap/other.js.coffee
effective_bootstrap-0.10.9 app/assets/javascripts/effective_bootstrap/other.js.coffee
effective_bootstrap-0.10.8 app/assets/javascripts/effective_bootstrap/other.js.coffee
effective_bootstrap-0.10.7 app/assets/javascripts/effective_bootstrap/other.js.coffee