Sha256: 56fed820a2037a9a4ed15ccf505df74c30a8b63d785a4acb4885f2383d996c7d

Contents?: true

Size: 1.19 KB

Versions: 8

Compression:

Stored size: 1.19 KB

Contents

#
# authorizable
#

# - start with given values
auth_types = $('#authority_authorizable_type').find("option:selected").val()
$('#authority_authorizable_id optgroup').find('option').addBack().hide()
$("#authority_authorizable_id optgroup[label=\"#{auth_types}\"]").find('option').addBack().show()

# - redisplay on change
$(document).on('click', '#authority_authorizable_type', ->
  type = $(this).find("option:selected").val()
  $('#authority_authorizable_id optgroup').find('option').addBack().hide()
  $("#authority_authorizable_id optgroup[label=\"#{type}\"]").find('option').addBack().show()
)

#
# authorized_for
#

# - start with given values
authfor_type = $('#authority_authorized_for_type').find("option:selected").val()
$('#authority_authorized_for_id optgroup').find('option').addBack().hide()
$("#authority_authorized_for_id optgroup[label=\"#{authfor_type}\"]").find('option').addBack().show()

# - redisplay on change
$(document).on('click', '#authority_authorized_for_type', ->
  type = $(this).find("option:selected").val()
  $('#authority_authorized_for_id optgroup').find('option').addBack().hide()
  $("#authority_authorized_for_id optgroup[label=\"#{type}\"]").find('option').addBack().show()
)

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
wobauth-5.0.1 app/assets/javascripts/wobauth/authorities.js.coffee
wobauth-5.0.0 app/assets/javascripts/wobauth/authorities.js.coffee
wobauth-4.0.0 app/assets/javascripts/wobauth/authorities.js.coffee
wobauth-3.4.8 app/assets/javascripts/wobauth/authorities.js.coffee
wobauth-3.4.7 app/assets/javascripts/wobauth/authorities.js.coffee
wobauth-3.4.6 app/assets/javascripts/wobauth/authorities.js.coffee
wobauth-3.4.5 app/assets/javascripts/wobauth/authorities.js.coffee
wobauth-3.4.4 app/assets/javascripts/wobauth/authorities.js.coffee