diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-02-25 18:08:50 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-02-25 18:08:50 +0300 |
commit | e06d0e779673d745972863302858105aad9032e5 (patch) | |
tree | 0ff35b27a949a164f586613004b4abfe33e7d20e /lib/banzai | |
parent | f7dae0cdcb70ecb71c1d65f099e9d96b27a4548c (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'lib/banzai')
-rw-r--r-- | lib/banzai/filter/label_reference_filter.rb | 17 | ||||
-rw-r--r-- | lib/banzai/filter/reference_filter.rb | 3 |
2 files changed, 12 insertions, 8 deletions
diff --git a/lib/banzai/filter/label_reference_filter.rb b/lib/banzai/filter/label_reference_filter.rb index 609ea8fb5ca..60ffb178393 100644 --- a/lib/banzai/filter/label_reference_filter.rb +++ b/lib/banzai/filter/label_reference_filter.rb @@ -93,23 +93,26 @@ module Banzai end presenter = object.present(issuable_subject: parent) - LabelsHelper.render_colored_label(presenter, label_suffix: label_suffix, title: tooltip_title(presenter)) + LabelsHelper.render_colored_label(presenter, suffix: label_suffix) end - def tooltip_title(label) - nil + def wrap_link(link, label) + presenter = label.present(issuable_subject: project || group) + LabelsHelper.wrap_label_html(link, small: true, label: presenter) end def full_path_ref?(matches) matches[:namespace] && matches[:project] end + def reference_class(type, tooltip: true) + super + ' gl-link gl-label-link' + end + def object_link_title(object, matches) - # use title of wrapped element instead - nil + presenter = object.present(issuable_subject: project || group) + LabelsHelper.label_tooltip_title(presenter) end end end end - -Banzai::Filter::LabelReferenceFilter.prepend_if_ee('EE::Banzai::Filter::LabelReferenceFilter') diff --git a/lib/banzai/filter/reference_filter.rb b/lib/banzai/filter/reference_filter.rb index b3ce9200b49..38bbed3cf72 100644 --- a/lib/banzai/filter/reference_filter.rb +++ b/lib/banzai/filter/reference_filter.rb @@ -37,7 +37,8 @@ module Banzai attributes[:reference_type] ||= self.class.reference_type attributes[:container] ||= 'body' - attributes[:placement] ||= 'bottom' + attributes[:placement] ||= 'top' + attributes[:html] ||= 'true' attributes.delete(:original) if context[:no_original_data] attributes.map do |key, value| %Q(data-#{key.to_s.dasherize}="#{escape_once(value)}") |