Skip to content

Commit

Permalink
disabled group button is any custom is disabled
Browse files Browse the repository at this point in the history
  • Loading branch information
lpichler committed Aug 8, 2017
1 parent 1d48408 commit 983ff26
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions app/helpers/application_helper/toolbar_builder.rb
Original file line number Diff line number Diff line change
Expand Up @@ -272,13 +272,15 @@ def create_raw_custom_button_hash(cb, record)

def custom_button_selects(model, record, toolbar_result)
get_custom_buttons(model, record, toolbar_result).collect do |group|
buttons = group[:buttons].collect { |b| create_custom_button(b, model, record) }

props = {
:id => "custom_#{group[:id]}",
:type => :buttonSelect,
:icon => "#{group[:image]} fa-lg",
:title => group[:description],
:enabled => true,
:items => group[:buttons].collect { |b| create_custom_button(b, model, record) }
:enabled => record ? true : buttons.all?{ |button| button[:enabled]},
:items => buttons
}
props[:text] = group[:text] if group[:text_display]

Expand Down

0 comments on commit 983ff26

Please sign in to comment.