Sha256: b4894ceb14b372458877fb5e9f90e65a18c4545ed11ecc695e35bb037d528ae8
Contents?: true
Size: 1018 Bytes
Versions: 9
Compression:
Stored size: 1018 Bytes
Contents
decko.slot.ready (slot) -> slot.find('._autocomplete').each (_i) -> decko.initAutoCardPlete($(this)) slot.find('._select2autocomplete').each (_i) -> decko.select2Autocomplete.init $(this) decko.initAutoCardPlete = (input) -> optionsCard = input.data 'options-card' return unless !!optionsCard path = optionsCard + '.json?view=name_match' input.autocomplete { source: decko.slot.path(path) } decko.select2Autocomplete = init: (el, options, ajaxOptions) -> opts = $.extend {}, @_defaults(el), options $.extend opts.ajax, ajaxOptions if ajaxOptions el.select2 opts _defaults: (el)-> multiple: false width: "100%!important" minimumInputLength: 0 maximumSelectionSize: 1 placeholder: el.attr("placeholder") escapeMarkup: (markup) -> markup ajax: delay: 200 cache: true url: decko.path ':search.json' processResults: (data) -> results: data data: (params) -> query: { keyword: params.term } view: "complete"
Version data entries
9 entries across 9 versions & 1 rubygems