Commit f8e220b6 authored by Rémy Coutable's avatar Rémy Coutable

Fix "Show all" link behavior

Fixes #14168
parent fe4d3abe
...@@ -14,8 +14,9 @@ v 8.6.0 (unreleased) ...@@ -14,8 +14,9 @@ v 8.6.0 (unreleased)
- Increase the notes polling timeout over time (Roberto Dip) - Increase the notes polling timeout over time (Roberto Dip)
v 8.5.5 v 8.5.5
- Ensure removing a project removes associated Todo entries. - Ensure removing a project removes associated Todo entries
- Prevent a 500 error in Todos when author was removed. - Prevent a 500 error in Todos when author was removed
- Fix "Show all" link behavior
v 8.5.4 v 8.5.4
- Do not cache requests for badges (including builds badge) - Do not cache requests for badges (including builds badge)
......
...@@ -2,20 +2,26 @@ class @ProjectsList ...@@ -2,20 +2,26 @@ class @ProjectsList
constructor: -> constructor: ->
$(".projects-list .js-expand").on 'click', (e) -> $(".projects-list .js-expand").on 'click', (e) ->
e.preventDefault() e.preventDefault()
list = $(this).closest('.projects-list') $projectsList = $(this).closest('.projects-list')
ProjectsList.showPagination($projectsList)
$projectsList.find('li.bottom').hide()
$("#filter_projects").on 'keyup', -> $("#filter_projects").on 'keyup', ->
ProjectsList.filter_results($("#filter_projects")) ProjectsList.filter_results($("#filter_projects"))
@showPagination: ($projectsList) ->
$projectsList.find('li').show()
$('.gl-pagination').show()
@filter_results: ($element) -> @filter_results: ($element) ->
terms = $element.val() terms = $element.val()
filterSelector = $element.data('filter-selector') || 'span.filter-title' filterSelector = $element.data('filter-selector') || 'span.filter-title'
$projectsList = $('.projects-list')
if not terms if not terms
$(".projects-list li").show() ProjectsList.showPagination($projectsList)
$('.gl-pagination').show()
else else
$(".projects-list li").each (index) -> $projectsList.find('li').each (index) ->
$this = $(this) $this = $(this)
name = $this.find(filterSelector).text() 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