Skip to content

Commit

Permalink
Merge pull request #94 from agmps17/master
Browse files Browse the repository at this point in the history
Resolving Bug1448
  • Loading branch information
cpg committed Jul 20, 2014
2 parents 038ddc7 + cbeddc8 commit c1a8d83
Showing 1 changed file with 9 additions and 11 deletions.
20 changes: 9 additions & 11 deletions app/helpers/tabs_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,8 @@
module TabsHelper

def tab_class(tab)
if params[:controller] == tab.id
klass = 'active'
else
subtab = Tab.find(params[:controller])
if subtab==nil
if Tab.ischild(params[:controller],tab)
klass = 'active'
end
end
end
klass = 'active' if params[:controller] == tab.id
klass = 'active' if !Tab.find(params[:controller]) && Tab.ischild(params[:controller],tab)
klass += " empty" unless tab.subtabs?
klass
end
Expand All @@ -37,11 +29,17 @@ def subtab_class(action = nil, tab_id)

def nav_class(tabs)
tabs.each do |tab|
return "subtab" if params[:controller] == tab.id && tab.subtabs?
return "subtab" if is_subtab(tab) && tab.subtabs?
end
""
end

def is_subtab(tab)
return true if params[:controller] == tab.id
return true if !Tab.find(params[:controller]) && Tab.ischild(params[:controller],tab)
false
end

def debug_tab?
advanced? || debug?
end
Expand Down

0 comments on commit c1a8d83

Please sign in to comment.