65105ff3bb
* Add search filtering for group projects * Show all user projects on dashboard * Refactor projects list into one view * Hide big list of projects with 'Show all' button
24 lines
739 B
CoffeeScript
24 lines
739 B
CoffeeScript
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()
|
|
uiBox = $(this).closest('.panel')
|
|
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()
|
|
|
|
|