Created by: alexkalderimis
Please merge this pull request to allow users to create tab pane systems where pane selectors are unknown at tab creation time.
Currently tabs expect jquery selectors only for tab pane target definition. This makes it difficult for dynamic tab construction where ids and thus selectors cannot be reliably generated. Also from an efficiency stand-point, repeated dom queries could be avoided where the target can be computed in advance.
This commit allows a tab a have its target defined using the data api, while giving precedence to the data-target element attribute for target definition. This in no way conflicts with the current behaviour of tabs, and opens up powerful avenues for extension with autogenerated tab systems.
My use case is an embedded widget which constructs tab panes as part of a dialogue process. As many widgets could be instantiated on each page, ids are not feasible for me to implement without some system for generating globally unique element ids. Simply using the data api is much simpler way of addressing this issue in a backwards compatible fashion.
Tests are included in the bootstrap-tabs unit test section.
A duplicate test (probably a copy-paste error) was removed from the tabs unit test.