ui.tabs: closable tabs (patch provided)

ui.tabs: closable tabs (patch provided)


Hi all,
I've implemented closable tabs.
Patch and example CSS / test page are attached to the trac page:
http://dev.jquery.com/ticket/2470
General Description:
* A clickable "button" (really an <A> tag) appears on the tab. When
the button is clicked, the tab is removed.
* <LI> tags are dynamically modified to contain a second tag:
<a onclick="return false;"><span>#{text}</span></a>
* The #{text} snippet will be replaced by the configuration option
closeText (which is '(x)' by default), and the snippet itself can be
set via the configuration option closeTemplate.
Specifics:
* New creation option closable can be set to false, 'all' or
'selected'
* default is false, meaning no closable tabs.
* 'all' means all tabs have are closable.
* 'selected' means only the selected tab is closable.
* New creation options closeTemplate and closeText allow overriding
default markup.
* When a tab is closable, a second <A> is dynamically added to the
tab <LI> after the normal <A>
* this tag is only added to the DOM if options.closable is non-
false
* this tag is hidden in unselected tabs if options.closable is
'selected'
* CSS / styles
* Note that this patch is backwards-compatible with CSS as long as
the closable option is not turned on.
* Close-button tag has class ui-tabs-close
* However, existing CSS will probably need to be modified to
support the new close button.
* A new class, ui-tabs-tab is associated with the normal <A> to
allow differentiation for themes/styles.
* see examples.tar.gz for example CSS support