Skip to content

Commit

Permalink
Allow main button labels
Browse files Browse the repository at this point in the history
  • Loading branch information
mlt committed May 22, 2018
1 parent 02d5879 commit 7c8bd45
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 5 additions & 1 deletion app/views/tabulatr/_tabulatr_buttons.html.slim
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
.btn-group
- buttons[:buttons].each do |button|
- o = (button[:options] || {}).merge(class: "btn btn-sm btn-default #{button[:options].try(:[], :class)}")
= link_to fa_icon(button[:icon]), button[:path], o
= link_to button[:path], o do
- if button[:icon].present?
=> fa_icon(button[:icon])
- if button[:label].present?
= button[:label]
- if buttons[:submenu].present?
button.btn.btn-default.btn-sm.dropdown-toggle data-toggle='dropdown'
span.caret
Expand Down
2 changes: 1 addition & 1 deletion lib/tabulatr/data/button_builder.rb
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ def val
def button(icon, path, options={})
label = options.dup.delete(:label)
if @mode == :buttons
@buttons << {icon: icon, path: path, options: options}
@buttons << {icon: icon, label: label, path: path, options: options}
else
@submenu << {icon: icon, label: label, path: path, options: options}
end
Expand Down

0 comments on commit 7c8bd45

Please sign in to comment.