Commit 849778d1 authored by Robert Speicher's avatar Robert Speicher

Merge branch 'backport-ee-helper-changes' into 'master'

Backport some EE helper changes

See merge request gitlab-org/gitlab-ce!23631
parents 7dd8ef3e 9cebc1f8
......@@ -11,6 +11,10 @@ module DropdownsHelper
dropdown_output = dropdown_toggle(toggle_text, data_attr, options)
if options.key?(:toggle_link)
dropdown_output = dropdown_toggle_link(toggle_text, data_attr, options)
end
dropdown_output << content_tag(:div, class: "dropdown-menu dropdown-select #{options[:dropdown_class] if options.key?(:dropdown_class)}") do
output = []
......@@ -49,6 +53,11 @@ module DropdownsHelper
end
end
def dropdown_toggle_link(toggle_text, data_attr, options = {})
output = content_tag(:a, toggle_text, class: "dropdown-toggle-text #{options[:toggle_class] if options.key?(:toggle_class)}", id: (options[:id] if options.key?(:id)), data: data_attr)
output.html_safe
end
def dropdown_title(title, options: {})
content_tag :div, class: "dropdown-title" do
title_output = []
......
......@@ -29,6 +29,11 @@ module SelectsHelper
classes = Array.wrap(opts[:class])
classes << 'ajax-groups-select'
# EE requires this line to be present, but there is no easy way of injecting
# this into EE without causing merge conflicts. Given this line is very
# simple and not really EE specific on its own, we just include it in CE.
classes << 'multiselect' if opts[:multiple]
opts[:class] = classes.join(' ')
select2_tag(id, opts)
......
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