Commit ea09a38f authored by Jacob Schatz's avatar Jacob Schatz

Merge branch 'fix/14168' into '8-5-stable'

Fix "Show all" link behavior

The "Show all" link was broken by recent refactors from @joshfng. I have fixed it very simply (I believe).

**Please note that this fix will be in 8.5.x only** (since the whole "Show all" stuff was moved to pagination recently (8.6).

Fixes #14168 

/cc @joshfng @dzaporozhets @razer6 

See merge request !3159
parents fe4d3abe f8e220b6
......@@ -14,8 +14,9 @@ v 8.6.0 (unreleased)
- Increase the notes polling timeout over time (Roberto Dip)
v 8.5.5
- Ensure removing a project removes associated Todo entries.
- Prevent a 500 error in Todos when author was removed.
- Ensure removing a project removes associated Todo entries
- Prevent a 500 error in Todos when author was removed
- Fix "Show all" link behavior
v 8.5.4
- Do not cache requests for badges (including builds badge)
......
......@@ -2,20 +2,26 @@ class @ProjectsList
constructor: ->
$(".projects-list .js-expand").on 'click', (e) ->
e.preventDefault()
list = $(this).closest('.projects-list')
$projectsList = $(this).closest('.projects-list')
ProjectsList.showPagination($projectsList)
$projectsList.find('li.bottom').hide()
$("#filter_projects").on 'keyup', ->
ProjectsList.filter_results($("#filter_projects"))
@showPagination: ($projectsList) ->
$projectsList.find('li').show()
$('.gl-pagination').show()
@filter_results: ($element) ->
terms = $element.val()
filterSelector = $element.data('filter-selector') || 'span.filter-title'
$projectsList = $('.projects-list')
if not terms
$(".projects-list li").show()
$('.gl-pagination').show()
ProjectsList.showPagination($projectsList)
else
$(".projects-list li").each (index) ->
$projectsList.find('li').each (index) ->
$this = $(this)
name = $this.find(filterSelector).text()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment