Sha256: 66c4b35eaed812997fa48c0b3ac04e7b658d7e2a5db19e18dc7aa751956574d1

Contents?: true

Size: 638 Bytes

Versions: 8

Compression:

Stored size: 638 Bytes

Contents

class Storytime.Dashboard.Tags
  init: () ->
    # Add new tags
    $(".tags-input").each ->
      tagsInput = $(this)
      searchInput = tagsInput.next("div").find(".search-field").children("input")
      searchInput.on 'keyup', (e) ->
        if e.which is 13 and searchInput.val().length > 0
          searched_tag = searchInput.val()
          tagsInput.append('<option value="nv__' + searched_tag + '">' + searched_tag + '</option>')

          selected_tags = tagsInput.val() || []
          selected_tags.push "nv__#{searched_tag}"

          tagsInput.val selected_tags
          tagsInput.trigger 'chosen:updated'
        return

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
storytime-2.1.6 app/assets/javascripts/storytime/tags.js.coffee
storytime-2.1.5 app/assets/javascripts/storytime/tags.js.coffee
storytime-2.1.4 app/assets/javascripts/storytime/tags.js.coffee
storytime-2.1.3 app/assets/javascripts/storytime/tags.js.coffee
storytime-2.1.2 app/assets/javascripts/storytime/tags.js.coffee
storytime-2.1.1 app/assets/javascripts/storytime/tags.js.coffee
storytime-2.1.0 app/assets/javascripts/storytime/tags.js.coffee
storytime-2.0.0 app/assets/javascripts/storytime/tags.js.coffee