mirror of
https://github.com/twbs/bootstrap.git
synced 2024-12-01 13:24:25 +01:00
Merge branch '1.3-wip' of github.com:twitter/bootstrap into 1.3-wip
This commit is contained in:
commit
df3ca4d94a
8
docs/assets/js/bootstrap-tabs.js
vendored
8
docs/assets/js/bootstrap-tabs.js
vendored
@ -11,17 +11,17 @@
|
|||||||
, $ul = $(e.liveFired)
|
, $ul = $(e.liveFired)
|
||||||
, $controlled
|
, $controlled
|
||||||
|
|
||||||
if (/^#/.test(href)) {
|
if (/^#\w+/.test(href)) {
|
||||||
e.preventDefault()
|
e.preventDefault()
|
||||||
|
|
||||||
if ($this.hasClass('active')) {
|
if ($this.hasClass('active')) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
$controlled = $('#' + $ul.attr('aria-controls'))
|
$href = $(href)
|
||||||
|
|
||||||
activate($this.parent('li'), $ul)
|
activate($this.parent('li'), $ul)
|
||||||
activate($(href, $controlled), $controlled)
|
activate($href, $href.parent())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -31,7 +31,7 @@
|
|||||||
|
|
||||||
$.fn.tabs = $.fn.pills = function () {
|
$.fn.tabs = $.fn.pills = function () {
|
||||||
return this.each(function () {
|
return this.each(function () {
|
||||||
$(this).delegate('.tabs > li > a, .pills > li > a', 'click', tab)
|
$(this).delegate('.tabs > li > a, .pills > li > a, .dropdown-menu > li > a', 'click', tab)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -99,8 +99,8 @@ $('#modal-content').modal({
|
|||||||
<!-- sample modal content -->
|
<!-- sample modal content -->
|
||||||
<div id="modal-from-dom" class="modal hide fade">
|
<div id="modal-from-dom" class="modal hide fade">
|
||||||
<div class="modal-header">
|
<div class="modal-header">
|
||||||
<h3>Modal Heading</h3>
|
|
||||||
<a href="#" class="close">×</a>
|
<a href="#" class="close">×</a>
|
||||||
|
<h3>Modal Heading</h3>
|
||||||
</div>
|
</div>
|
||||||
<div class="modal-body">
|
<div class="modal-body">
|
||||||
<p>One fine body…</p>
|
<p>One fine body…</p>
|
||||||
@ -254,19 +254,17 @@ $('#modal-content').modal({
|
|||||||
<h3>Method</h3>
|
<h3>Method</h3>
|
||||||
<h4>$().tabs or $().pills</h4>
|
<h4>$().tabs or $().pills</h4>
|
||||||
<p>
|
<p>
|
||||||
Activates tab and pill functionality for a given container.
|
Activates tab and pill functionality for a given container. Tab links should reference id's in the document.
|
||||||
</p>
|
</p>
|
||||||
<p>
|
|
||||||
<strong>Note:</strong> The controlled container is defined by a required <code>aria-controls</code> attribute added to your <code>.tabs</code> or <code>.pills</code>. The <a href="http://www.w3.org/TR/wai-aria/states_and_properties#aria-controls">aria-controls</a> attribute must reference an element's id.
|
|
||||||
<pre class="prettyprint linenums">
|
<pre class="prettyprint linenums">
|
||||||
<ul class="tabs" aria-controls="my-pill-content">
|
<ul class="tabs">
|
||||||
<li class="active"><a href="#home">Home</a></li>
|
<li class="active"><a href="#home">Home</a></li>
|
||||||
<li><a href="#profile">Profile</a></li>
|
<li><a href="#profile">Profile</a></li>
|
||||||
<li><a href="#messages">Messages</a></li>
|
<li><a href="#messages">Messages</a></li>
|
||||||
<li><a href="#settings">Settings</a></li>
|
<li><a href="#settings">Settings</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
<div class="pill-content" id="my-pill-content">
|
<div class="pill-content">
|
||||||
<div class="active" id="home">...</div>
|
<div class="active" id="home">...</div>
|
||||||
<div id="profile">...</div>
|
<div id="profile">...</div>
|
||||||
<div id="messages">...</div>
|
<div id="messages">...</div>
|
||||||
|
Loading…
Reference in New Issue
Block a user