BigW Consortium Gitlab

projects_list.js.coffee 754 Bytes
Newer Older
1 2 3 4 5 6 7 8 9 10
class @ProjectsList
  constructor: ->
    $(".projects-list .js-expand").on 'click', (e) ->
      e.preventDefault()
      list = $(this).closest('.projects-list')
      list.find("li").show()
      list.find("li.bottom").hide()

    $(".projects-list-filter").keyup ->
      terms = $(this).val()
11
      uiBox = $(this).closest('.projects-list-holder')
12 13 14 15 16 17 18 19 20 21 22 23 24
      if terms == "" || terms == undefined
        uiBox.find(".projects-list li").show()
      else
        uiBox.find(".projects-list li").each (index) ->
          name = $(this).find(".filter-title").text()

          if name.toLowerCase().search(terms.toLowerCase()) == -1
            $(this).hide()
          else
            $(this).show()
      uiBox.find(".projects-list li.bottom").hide()