Skip to content
代码片段 群组 项目
提交 1576ecee 编辑于 作者: Olena Horal-Koretska's avatar Olena Horal-Koretska
浏览文件

Migrate markdown toolbar buttons to Pajamas::ButtonComponent

上级 ac9bc2ac
No related branches found
No related tags found
无相关合并请求
......@@ -110,8 +110,8 @@ def markup(file_name, text, context = {})
prepare_asciidoc_context(file_name, context)
html = Markup::RenderingService
.new(text, file_name: file_name, context: context, postprocess_context: postprocess_context)
.execute
.new(text, file_name: file_name, context: context, postprocess_context: postprocess_context)
.execute
Hamlit::RailsHelpers.preserve(html)
end
......@@ -124,8 +124,8 @@ def render_wiki_content(wiki_page, context = {})
prepare_asciidoc_context(wiki_page.path, context)
html = Markup::RenderingService
.new(text, file_name: wiki_page.path, context: context, postprocess_context: postprocess_context)
.execute
.new(text, file_name: wiki_page.path, context: context, postprocess_context: postprocess_context)
.execute
Hamlit::RailsHelpers.preserve(html)
end
......@@ -192,15 +192,21 @@ def render_links(text)
def markdown_toolbar_button(options = {})
data = options[:data].merge({ container: 'body' })
css_classes = %w[gl-button btn btn-default-tertiary btn-icon btn-sm js-md has-tooltip] << options[:css_class].to_s
content_tag :button,
type: 'button',
class: css_classes.join(' '),
data: data,
title: options[:title],
aria: { label: options[:title] } do
sprite_icon(options[:icon])
end
css_classes = %w[js-md has-tooltip] << options[:css_class].to_s
render Pajamas::ButtonComponent.new(
category: :tertiary,
size: :small,
icon: options[:icon],
button_options: {
class: css_classes.join(' '),
data: data,
title: options[:title],
aria: {
label: options[:title]
}
}
)
end
def render_markdown_field(object, field, context = {})
......
0% 加载中 .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册