End code:

<def tag="hjq-tabs" attrs="id">
    <% id ||= "tabs" -%>
    <script>
        jQuery(function() {
          jQuery( "#<%= id %>" ).tabs();
        });
    </script>
    <div id="#{id}" param="wrapper">
        <set-scoped tabs="&[]">
            <ul param="default" />
            <repeat with="&scope.tabs">
                <div id="#{this[0]}"><%= this[1] %></div>
            </repeat>
        </set-scoped>
    </div>
</def>

<def tag="hjq-tab" attrs="label,id"><% 
    raise "Tab tag must be used inside tabs tag." if scope.tabs.nil?
    id ||= "tab#{scope.tabs.length}"
    scope.tabs << [id, parameters.default] -%>
    <li><a href="##{id}"><%= label %></a></li>
</def>

Working as desired:

<hjq-tabs>
  <hjq-tab label="Step 1">...</hjq-tab>
  <hjq-tab label="Step 2">...</hjq-tab>
  ...
</hjq-tabs>

I'd wrap it up like the rest of the hobo-jquery plugin but honestly I'm not 
sure what a good chunk of that code is for :D.  Feel free to modify and 
include in whatever.

-- 
You received this message because you are subscribed to the Google Groups "Hobo 
Users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/hobousers/-/AgDtLmRI_68J.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/hobousers?hl=en.

Reply via email to