Sha256: 9e6884c486c36b28787f9c708024dfcea24a58f51243eb4560c231b7a19a559a

Contents?: true

Size: 1.57 KB

Versions: 56

Compression:

Stored size: 1.57 KB

Contents

$.fn.multiSelect.defaults =
  qs1: null
  qs2: null
  selectableOptgroup: false
  selectableHeader:  "<input type='text' class='search-input form-control' autocomplete='off' placeholder='Search in selectable items'><br/>"
  selectionHeader:   "<input type='text' class='search-input form-control' autocomplete='off' placeholder='Search in selected items'><br/>"
  afterInit: (ms) ->
    that = this
    that.options.selectableOptgroup = if $(this)[0].$element.data('selectableOptgroup') then true else false

    if $(this)[0].$element.data('searchable')
      $selectableSearch      = that.$selectableUl.siblings('input')
      $selectionSearch       = that.$selectionUl.siblings('input')
      $selectionSearch       = that.$selectionUl.siblings('input')
      selectableSearchString = "#" + that.$container.attr("id") + " .ms-elem-selectable:not(.ms-selected)"
      selectionSearchString  = "#" + that.$container.attr("id") + " .ms-elem-selection.ms-selected"

      that.qs1 = $selectableSearch.quicksearch(selectableSearchString).on("keydown", (e) ->
        if e.which is 40
          that.$selectableUl.focus()
          false
      )
      that.qs2 = $selectionSearch.quicksearch(selectionSearchString).on("keydown", (e) ->
        if e.which is 40
          that.$selectionUl.focus()
          false
      )
    else
      that.$selectableContainer.children('.search-input').remove()
      that.$selectionContainer.children('.search-input').remove()

  afterSelect: ->
    @qs1.cache() if @qs1?
    @qs2.cache() if @qs2?

  afterDeselect: ->
    @qs1.cache() if @qs1?
    @qs2.cache() if @qs2?

Version data entries

56 entries across 56 versions & 1 rubygems

Version Path
ui_bibz-2.5.6 app/assets/javascripts/jquery.multi-select-extend.coffee
ui_bibz-2.5.5 app/assets/javascripts/jquery.multi-select-extend.coffee
ui_bibz-2.5.3 app/assets/javascripts/jquery.multi-select-extend.coffee
ui_bibz-2.5.2 app/assets/javascripts/jquery.multi-select-extend.coffee
ui_bibz-2.5.1 app/assets/javascripts/jquery.multi-select-extend.coffee
ui_bibz-2.5.0 app/assets/javascripts/jquery.multi-select-extend.coffee
ui_bibz-2.4.0 app/assets/javascripts/jquery.multi-select-extend.coffee
ui_bibz-2.3.15 app/assets/javascripts/jquery.multi-select-extend.coffee
ui_bibz-2.3.14 app/assets/javascripts/jquery.multi-select-extend.coffee
ui_bibz-2.3.13 app/assets/javascripts/jquery.multi-select-extend.coffee
ui_bibz-2.3.12 app/assets/javascripts/jquery.multi-select-extend.coffee
ui_bibz-2.3.11 app/assets/javascripts/jquery.multi-select-extend.coffee
ui_bibz-2.3.10 app/assets/javascripts/jquery.multi-select-extend.coffee
ui_bibz-2.3.9 app/assets/javascripts/jquery.multi-select-extend.coffee
ui_bibz-2.3.8 app/assets/javascripts/jquery.multi-select-extend.coffee
ui_bibz-2.3.7 app/assets/javascripts/jquery.multi-select-extend.coffee
ui_bibz-2.3.6 app/assets/javascripts/jquery.multi-select-extend.coffee
ui_bibz-2.3.5 app/assets/javascripts/jquery.multi-select-extend.coffee
ui_bibz-2.3.4 app/assets/javascripts/jquery.multi-select-extend.coffee
ui_bibz-2.3.3 app/assets/javascripts/jquery.multi-select-extend.coffee