techiferous / tabulous

Easy tabbed navigation for Rails
Other
322 stars 35 forks source link

render_dropdown_tab #15

Closed koukou73gr closed 12 years ago

koukou73gr commented 12 years ago

I believe I found a mistype of shorts... In lib/tabulous/tabulous.rb, line 114, I think it should read: ... %Q{ href="#{options[:path]}" >}

As it is now, when @@active_tab_clickable == true, the tab link path is just a '#' and clicking does nothing.

If this is intentional however, could you consider adding a conditional to change the behaviour as above?

The bootstrap style with subtabs as <ul>'s inside parent tab's <li> can be easily coupled with a little CSS to have the subtabs rendered as a dropdown only on hover, much like what happens in Twitter Bootstrap I guess (although I've never took a look there myself so far :p ). But having the parent tab unclickable breaks the concept I have in mind ...

Thanks for reading,

-Kostas

koukou73gr commented 12 years ago

On the same issue, I'd expect disabled subtabs to be rendered like this:

  if subtab.enabled?(view)
    html << '<li class="enabled">'
    html << %Q{<a href="#{subtab.path(view)}">#{subtab.text(view)}</a>}
  else
    html << '<li class="disabled">'
    html << %Q{<a href="javascript:void(0)">#{subtab.text(view)}</a>}
  end
  html << '</li>'
techiferous commented 12 years ago

Thank you for bringing this to my attention. I will look into this more when I have some time.

techiferous commented 12 years ago

Hi,

I've looked into this issue and this is expected behavior. The "#" href is not a bug, but how you should code tabs that have a dropdown in Twitter Bootstrap. The reason that the href is "#" instead of a path is that Twitter Bootstrap has JavaScript that displays the subtabs when you click on the dropdown. Refer to http://twitter.github.com/bootstrap/components.html#navs

If you want to have the subtabs appear on hover instead of click, you may be able to do this by modifying Twitter Bootstrap's JavaScript. A quick Google search reveals this: http://stackoverflow.com/questions/9815247/how-to-make-with-twitter-bootstrap-tabs-on-hover-instead-of-clicking

Thank you for your interest in Tabulous.