Sha256: bf354d0725fb88059f6386ebc06ab48df38df975e84b76afacf6f7b618ba38b8

Contents?: true

Size: 621 Bytes

Versions: 2

Compression:

Stored size: 621 Bytes

Contents

can_comable_tagit = ->
  return false unless comable_tagit_available_tags?
  return false unless $("#comable-tagit").length
  true

initializa_comable_tagit = ->
  return unless can_comable_tagit()

  $("#comable-tagit").tagit({
    fieldName: 'product[category_path_names][]',
    availableTags: comable_tagit_available_tags,
    autocomplete: { delay: 0, minLength: 0 },
    showAutocompleteOnFocus: true,
    removeConfirmation: true,
    # Only allow available tags
    beforeTagAdded: (event, ui) -> (comable_tagit_available_tags.indexOf(ui.tagLabel) != -1)
  })

$(document).ready(->
  initializa_comable_tagit()
)

Version data entries

2 entries across 2 versions & 2 rubygems

Version Path
comable-backend-0.6.0 app/assets/javascripts/comable/admin/products.coffee
comable_backend-0.5.0 app/assets/javascripts/comable/admin/products.coffee