Skip to content

Commit

Permalink
Resolving Bug1448
Browse files Browse the repository at this point in the history
Signed-off-by: Arpit Goyal <[email protected]>
  • Loading branch information
agmps17 committed Jul 20, 2014
1 parent 040b9f8 commit cbeddc8
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 cbeddc8

Please sign in to comment.