Skip to content

Commit

Permalink
CustomButtons: remove question marks from custom_toolbar*?.
Browse files Browse the repository at this point in the history
  • Loading branch information
martinpovolny committed Apr 11, 2017
1 parent 6834d56 commit b6408ee
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions app/controllers/mixins/custom_buttons.rb
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
module Mixins::CustomButtons
extend ActiveSupport::Concern

def custom_toolbar?
def custom_toolbar
return nil unless self.class.instance_eval { @custom_buttons }

@explorer ? custom_toolbar_explorer? : custom_toolbar_simple?
@explorer ? custom_toolbar_explorer : custom_toolbar_simple
end

def custom_toolbar_explorer?
def custom_toolbar_explorer
if x_tree
if @display == "main" && @record
Mixins::CustomButtons::Result.new(:single)
Expand All @@ -19,7 +19,7 @@ def custom_toolbar_explorer?
end
end

def custom_toolbar_simple?
def custom_toolbar_simple
if @record && @lastaction == "show" && @display == "main"
Mixins::CustomButtons::Result.new(:single)
elsif @lastaction == "show_list"
Expand Down
2 changes: 1 addition & 1 deletion app/helpers/application_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -718,7 +718,7 @@ def calculate_toolbars
end

toolbars['center_tb'] = center_toolbar_filename
toolbars['custom_tb'] = controller.custom_toolbar?
toolbars['custom_tb'] = controller.custom_toolbar

toolbars['view_tb'] = inner_layout_present? ? x_view_toolbar_filename : view_toolbar_filename
toolbars
Expand Down

0 comments on commit b6408ee

Please sign in to comment.