ninja / ui

Ninja User Interface, the jQuery plugin for lethal interaction.
http://ninjaui.com
Apache License 2.0
284 stars 23 forks source link

Tabs are index from 1, not 0 #53

Open mboudreau opened 12 years ago

mboudreau commented 12 years ago

I was creating tabs and what trying to figure out why setting it to 1 always chose the first tab since it wasn't mentioned in the documentation and that everything in javascript is zero based index.

For example: var tabs = $.ninja.tabs({values: [ {html:"no"}, {html:"yes"} ], value: 1}); Would select "no", and not "yes" as expected.

This was changed easily in the ninjaui code by making "0" the default value and removing the "- 1" in

if (i === options.value - 1) { $tab.select(); }

Under the tabs function.