Merge branch 'task-list-class' into 'master'
Properly set task-list class on single item task lists Fixes https://gitlab.com/gitlab-org/gitlab-ce/issues/4193 See merge request !2330
This commit is contained in:
commit
b1539116f6
|
@ -23,6 +23,7 @@ v 8.4.0 (unreleased)
|
|||
- Update version check images to use SVG
|
||||
- Validate README format before displaying
|
||||
- Enable Microsoft Azure OAuth2 support (Janis Meybohm)
|
||||
- Properly set task-list class on single item task lists
|
||||
- Add file finder feature in tree view (koreamic)
|
||||
- Ajax filter by message for commits page
|
||||
|
||||
|
|
|
@ -12,13 +12,18 @@ module Banzai
|
|||
#
|
||||
# See https://github.com/github/task_list/pull/60
|
||||
class TaskListFilter < TaskList::Filter
|
||||
def add_css_class(node, *new_class_names)
|
||||
def add_css_class_with_fix(node, *new_class_names)
|
||||
if new_class_names.include?('task-list')
|
||||
super if node.children.any? { |c| c['class'] == 'task-list-item' }
|
||||
else
|
||||
super
|
||||
# Don't add class to all lists
|
||||
return
|
||||
elsif new_class_names.include?('task-list-item')
|
||||
add_css_class_without_fix(node.parent, 'task-list')
|
||||
end
|
||||
|
||||
add_css_class_without_fix(node, *new_class_names)
|
||||
end
|
||||
|
||||
alias_method_chain :add_css_class, :fix
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue