Sha256: ece601bbdc09d9b0b74e7f444fa17a4fdf22307adc3f0949bb5ac98afc025396

Contents?: true

Size: 451 Bytes

Versions: 1

Compression:

Stored size: 451 Bytes

Contents

class @Tags

  constructor: (element, options={}) ->
    @el = $(element)
    @el.textext(
      plugins: 'autocomplete ajax tags arrow'
      tags:
        items: @initTags()
      ajax:
        url: '/admin/api/tags/'
        type: 'GET'
        cacheResults: true
    )

  initTags: () =>
    tags = @el.text().split(', ')
    @el.text('')
    tags

$.fn.taggable = ->
  @each ->
    new Tags(this)

jQuery ->
  $('textarea.js-taggable').taggable()

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
georgia-0.8.0 app/assets/javascripts/georgia/components/tags.js.coffee