mirror of
https://github.com/twbs/bootstrap.git
synced 2025-08-14 01:24:19 +02:00
Merge branch '2.1.0-wip' of github.com:twitter/bootstrap into 2.1.0-wip
This commit is contained in:
@@ -31,20 +31,6 @@
|
|||||||
$(this).parents('.add-on')[method]('active')
|
$(this).parents('.add-on')[method]('active')
|
||||||
})
|
})
|
||||||
|
|
||||||
// position static twipsies for components page
|
|
||||||
if ($(".twipsies a").length) {
|
|
||||||
$(window).on('load resize', function () {
|
|
||||||
$(".twipsies a").each(function () {
|
|
||||||
$(this)
|
|
||||||
.tooltip({
|
|
||||||
placement: $(this).attr('title')
|
|
||||||
, trigger: 'manual'
|
|
||||||
})
|
|
||||||
.tooltip('show')
|
|
||||||
})
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
// add tipsies to grid for scaffolding
|
// add tipsies to grid for scaffolding
|
||||||
if ($('#gridSystem').length) {
|
if ($('#gridSystem').length) {
|
||||||
$('#gridSystem').tooltip({
|
$('#gridSystem').tooltip({
|
||||||
|
8
docs/assets/js/bootstrap-dropdown.js
vendored
8
docs/assets/js/bootstrap-dropdown.js
vendored
@@ -140,11 +140,11 @@
|
|||||||
|
|
||||||
$(function () {
|
$(function () {
|
||||||
$('html')
|
$('html')
|
||||||
.on('click.dropdown.data-api', clearMenus)
|
.on('click.dropdown.data-api touchstart.dropdown.data-api', clearMenus)
|
||||||
$('body')
|
$('body')
|
||||||
.on('click.dropdown', '.dropdown form', function (e) { e.stopPropagation() })
|
.on('click.dropdown touchstart.dropdown.data-api', '.dropdown', function (e) { e.stopPropagation() })
|
||||||
.on('click.dropdown.data-api' , toggle, Dropdown.prototype.toggle)
|
.on('click.dropdown.data-api touchstart.dropdown.data-api' , toggle, Dropdown.prototype.toggle)
|
||||||
.on('keydown.dropdown.data-api', toggle + ', [role=menu]' , Dropdown.prototype.keydown)
|
.on('keydown.dropdown.data-api touchstart.dropdown.data-api', toggle + ', [role=menu]' , Dropdown.prototype.keydown)
|
||||||
})
|
})
|
||||||
|
|
||||||
}(window.jQuery);
|
}(window.jQuery);
|
1
docs/assets/js/bootstrap-popover.js
vendored
1
docs/assets/js/bootstrap-popover.js
vendored
@@ -95,6 +95,7 @@
|
|||||||
|
|
||||||
$.fn.popover.defaults = $.extend({} , $.fn.tooltip.defaults, {
|
$.fn.popover.defaults = $.extend({} , $.fn.tooltip.defaults, {
|
||||||
placement: 'right'
|
placement: 'right'
|
||||||
|
, trigger: 'click'
|
||||||
, content: ''
|
, content: ''
|
||||||
, template: '<div class="popover"><div class="arrow"></div><div class="popover-inner"><h3 class="popover-title"></h3><div class="popover-content"><p></p></div></div></div>'
|
, template: '<div class="popover"><div class="arrow"></div><div class="popover-inner"><h3 class="popover-title"></h3><div class="popover-content"><p></p></div></div></div>'
|
||||||
})
|
})
|
||||||
|
6
docs/assets/js/bootstrap-tooltip.js
vendored
6
docs/assets/js/bootstrap-tooltip.js
vendored
@@ -44,8 +44,10 @@
|
|||||||
this.options = this.getOptions(options)
|
this.options = this.getOptions(options)
|
||||||
this.enabled = true
|
this.enabled = true
|
||||||
|
|
||||||
if (this.options.trigger != 'manual') {
|
if (this.options.trigger == 'click') {
|
||||||
eventIn = this.options.trigger == 'hover' ? 'mouseenter' : 'focus'
|
this.$element.on('click.' + this.type, this.options.selector, $.proxy(this.toggle, this))
|
||||||
|
} else if (this.options.trigger != 'manual') {
|
||||||
|
eventIn = this.options.trigger == 'hover' ? 'mouseenter' : 'focus'
|
||||||
eventOut = this.options.trigger == 'hover' ? 'mouseleave' : 'blur'
|
eventOut = this.options.trigger == 'hover' ? 'mouseleave' : 'blur'
|
||||||
this.$element.on(eventIn + '.' + this.type, this.options.selector, $.proxy(this.enter, this))
|
this.$element.on(eventIn + '.' + this.type, this.options.selector, $.proxy(this.enter, this))
|
||||||
this.$element.on(eventOut + '.' + this.type, this.options.selector, $.proxy(this.leave, this))
|
this.$element.on(eventOut + '.' + this.type, this.options.selector, $.proxy(this.leave, this))
|
||||||
|
15
docs/assets/js/bootstrap.js
vendored
15
docs/assets/js/bootstrap.js
vendored
@@ -715,11 +715,11 @@
|
|||||||
|
|
||||||
$(function () {
|
$(function () {
|
||||||
$('html')
|
$('html')
|
||||||
.on('click.dropdown.data-api', clearMenus)
|
.on('click.dropdown.data-api touchstart.dropdown.data-api', clearMenus)
|
||||||
$('body')
|
$('body')
|
||||||
.on('click.dropdown', '.dropdown form', function (e) { e.stopPropagation() })
|
.on('click.dropdown touchstart.dropdown.data-api', '.dropdown', function (e) { e.stopPropagation() })
|
||||||
.on('click.dropdown.data-api' , toggle, Dropdown.prototype.toggle)
|
.on('click.dropdown.data-api touchstart.dropdown.data-api' , toggle, Dropdown.prototype.toggle)
|
||||||
.on('keydown.dropdown.data-api', toggle + ', [role=menu]' , Dropdown.prototype.keydown)
|
.on('keydown.dropdown.data-api touchstart.dropdown.data-api', toggle + ', [role=menu]' , Dropdown.prototype.keydown)
|
||||||
})
|
})
|
||||||
|
|
||||||
}(window.jQuery);/* =========================================================
|
}(window.jQuery);/* =========================================================
|
||||||
@@ -1006,8 +1006,10 @@
|
|||||||
this.options = this.getOptions(options)
|
this.options = this.getOptions(options)
|
||||||
this.enabled = true
|
this.enabled = true
|
||||||
|
|
||||||
if (this.options.trigger != 'manual') {
|
if (this.options.trigger == 'click') {
|
||||||
eventIn = this.options.trigger == 'hover' ? 'mouseenter' : 'focus'
|
this.$element.on('click.' + this.type, this.options.selector, $.proxy(this.toggle, this))
|
||||||
|
} else if (this.options.trigger != 'manual') {
|
||||||
|
eventIn = this.options.trigger == 'hover' ? 'mouseenter' : 'focus'
|
||||||
eventOut = this.options.trigger == 'hover' ? 'mouseleave' : 'blur'
|
eventOut = this.options.trigger == 'hover' ? 'mouseleave' : 'blur'
|
||||||
this.$element.on(eventIn + '.' + this.type, this.options.selector, $.proxy(this.enter, this))
|
this.$element.on(eventIn + '.' + this.type, this.options.selector, $.proxy(this.enter, this))
|
||||||
this.$element.on(eventOut + '.' + this.type, this.options.selector, $.proxy(this.leave, this))
|
this.$element.on(eventOut + '.' + this.type, this.options.selector, $.proxy(this.leave, this))
|
||||||
@@ -1330,6 +1332,7 @@
|
|||||||
|
|
||||||
$.fn.popover.defaults = $.extend({} , $.fn.tooltip.defaults, {
|
$.fn.popover.defaults = $.extend({} , $.fn.tooltip.defaults, {
|
||||||
placement: 'right'
|
placement: 'right'
|
||||||
|
, trigger: 'click'
|
||||||
, content: ''
|
, content: ''
|
||||||
, template: '<div class="popover"><div class="arrow"></div><div class="popover-inner"><h3 class="popover-title"></h3><div class="popover-content"><p></p></div></div></div>'
|
, template: '<div class="popover"><div class="arrow"></div><div class="popover-inner"><h3 class="popover-title"></h3><div class="popover-content"><p></p></div></div></div>'
|
||||||
})
|
})
|
||||||
|
2
docs/assets/js/bootstrap.min.js
vendored
2
docs/assets/js/bootstrap.min.js
vendored
File diff suppressed because one or more lines are too long
@@ -566,7 +566,7 @@ $('#myModal').on('hidden', function () {
|
|||||||
<h2>Usage</h2>
|
<h2>Usage</h2>
|
||||||
|
|
||||||
<h3>Via data attributes</h3>
|
<h3>Via data attributes</h3>
|
||||||
<p>To easily add scrollspy behavior to your topbar navigation, just add <code>data-spy="scroll"</code> to the element you want to spy on (most typically this would be the body) and <code>data-target=".navbar"</code> to select which nav to use.</p>
|
<p>To easily add scrollspy behavior to your topbar navigation, just add <code>data-spy="scroll"</code> to the element you want to spy on (most typically this would be the body) and <code>data-target=".navbar"</code> to select which nav to use. You'll want to use scrollspy with a <code>.nav</code> component.</p>
|
||||||
<pre class="prettyprint linenums"><body data-spy="scroll" data-target=".navbar">...</body></pre>
|
<pre class="prettyprint linenums"><body data-spy="scroll" data-target=".navbar">...</body></pre>
|
||||||
|
|
||||||
<h3>Via JavaScript</h3>
|
<h3>Via JavaScript</h3>
|
||||||
@@ -829,7 +829,7 @@ $('a[data-toggle="tab"]').on('shown', function (e) {
|
|||||||
<td>trigger</td>
|
<td>trigger</td>
|
||||||
<td>string</td>
|
<td>string</td>
|
||||||
<td>'hover'</td>
|
<td>'hover'</td>
|
||||||
<td>how tooltip is triggered - hover | focus | manual</td>
|
<td>how tooltip is triggered - click | hover | focus | manual</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>delay</td>
|
<td>delay</td>
|
||||||
@@ -922,7 +922,7 @@ $('a[data-toggle="tab"]').on('shown', function (e) {
|
|||||||
|
|
||||||
<h3>Live demo</h3>
|
<h3>Live demo</h3>
|
||||||
<div class="bs-docs-example" style="padding-bottom: 24px;">
|
<div class="bs-docs-example" style="padding-bottom: 24px;">
|
||||||
<a href="#" class="btn btn-large btn-danger" rel="popover" title="A Title" data-content="And here's some amazing content. It's very engaging. right?">Hover for popover</a>
|
<a href="#" class="btn btn-large btn-danger" rel="popover" title="A Title" data-content="And here's some amazing content. It's very engaging. right?">Click to toggle popover</a>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
@@ -972,8 +972,8 @@ $('a[data-toggle="tab"]').on('shown', function (e) {
|
|||||||
<tr>
|
<tr>
|
||||||
<td>trigger</td>
|
<td>trigger</td>
|
||||||
<td>string</td>
|
<td>string</td>
|
||||||
<td>'hover'</td>
|
<td>'click'</td>
|
||||||
<td>how popover is triggered - hover | focus | manual</td>
|
<td>how popover is triggered - click | hover | focus | manual</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>title</td>
|
<td>title</td>
|
||||||
|
10
docs/templates/pages/javascript.mustache
vendored
10
docs/templates/pages/javascript.mustache
vendored
@@ -496,7 +496,7 @@ $('#myModal').on('hidden', function () {
|
|||||||
<h2>{{_i}}Usage{{/i}}</h2>
|
<h2>{{_i}}Usage{{/i}}</h2>
|
||||||
|
|
||||||
<h3>{{_i}}Via data attributes{{/i}}</h3>
|
<h3>{{_i}}Via data attributes{{/i}}</h3>
|
||||||
<p>{{_i}}To easily add scrollspy behavior to your topbar navigation, just add <code>data-spy="scroll"</code> to the element you want to spy on (most typically this would be the body) and <code>data-target=".navbar"</code> to select which nav to use.{{/i}}</p>
|
<p>{{_i}}To easily add scrollspy behavior to your topbar navigation, just add <code>data-spy="scroll"</code> to the element you want to spy on (most typically this would be the body) and <code>data-target=".navbar"</code> to select which nav to use. You'll want to use scrollspy with a <code>.nav</code> component.{{/i}}</p>
|
||||||
<pre class="prettyprint linenums"><body data-spy="scroll" data-target=".navbar">...</body></pre>
|
<pre class="prettyprint linenums"><body data-spy="scroll" data-target=".navbar">...</body></pre>
|
||||||
|
|
||||||
<h3>{{_i}}Via JavaScript{{/i}}</h3>
|
<h3>{{_i}}Via JavaScript{{/i}}</h3>
|
||||||
@@ -759,7 +759,7 @@ $('a[data-toggle="tab"]').on('shown', function (e) {
|
|||||||
<td>{{_i}}trigger{{/i}}</td>
|
<td>{{_i}}trigger{{/i}}</td>
|
||||||
<td>{{_i}}string{{/i}}</td>
|
<td>{{_i}}string{{/i}}</td>
|
||||||
<td>'hover'</td>
|
<td>'hover'</td>
|
||||||
<td>{{_i}}how tooltip is triggered{{/i}} - hover | focus | manual</td>
|
<td>{{_i}}how tooltip is triggered{{/i}} - click | hover | focus | manual</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>{{_i}}delay{{/i}}</td>
|
<td>{{_i}}delay{{/i}}</td>
|
||||||
@@ -852,7 +852,7 @@ $('a[data-toggle="tab"]').on('shown', function (e) {
|
|||||||
|
|
||||||
<h3>Live demo</h3>
|
<h3>Live demo</h3>
|
||||||
<div class="bs-docs-example" style="padding-bottom: 24px;">
|
<div class="bs-docs-example" style="padding-bottom: 24px;">
|
||||||
<a href="#" class="btn btn-large btn-danger" rel="popover" title="A Title" data-content="And here's some amazing content. It's very engaging. right?">{{_i}}Hover for popover{{/i}}</a>
|
<a href="#" class="btn btn-large btn-danger" rel="popover" title="A Title" data-content="And here's some amazing content. It's very engaging. right?">{{_i}}Click to toggle popover{{/i}}</a>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
@@ -902,8 +902,8 @@ $('a[data-toggle="tab"]').on('shown', function (e) {
|
|||||||
<tr>
|
<tr>
|
||||||
<td>{{_i}}trigger{{/i}}</td>
|
<td>{{_i}}trigger{{/i}}</td>
|
||||||
<td>{{_i}}string{{/i}}</td>
|
<td>{{_i}}string{{/i}}</td>
|
||||||
<td>'hover'</td>
|
<td>'click'</td>
|
||||||
<td>{{_i}}how popover is triggered{{/i}} - hover | focus | manual</td>
|
<td>{{_i}}how popover is triggered{{/i}} - click | hover | focus | manual</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>{{_i}}title{{/i}}</td>
|
<td>{{_i}}title{{/i}}</td>
|
||||||
|
8
js/bootstrap-dropdown.js
vendored
8
js/bootstrap-dropdown.js
vendored
@@ -140,11 +140,11 @@
|
|||||||
|
|
||||||
$(function () {
|
$(function () {
|
||||||
$('html')
|
$('html')
|
||||||
.on('click.dropdown.data-api', clearMenus)
|
.on('click.dropdown.data-api touchstart.dropdown.data-api', clearMenus)
|
||||||
$('body')
|
$('body')
|
||||||
.on('click.dropdown', '.dropdown form', function (e) { e.stopPropagation() })
|
.on('click.dropdown touchstart.dropdown.data-api', '.dropdown', function (e) { e.stopPropagation() })
|
||||||
.on('click.dropdown.data-api' , toggle, Dropdown.prototype.toggle)
|
.on('click.dropdown.data-api touchstart.dropdown.data-api' , toggle, Dropdown.prototype.toggle)
|
||||||
.on('keydown.dropdown.data-api', toggle + ', [role=menu]' , Dropdown.prototype.keydown)
|
.on('keydown.dropdown.data-api touchstart.dropdown.data-api', toggle + ', [role=menu]' , Dropdown.prototype.keydown)
|
||||||
})
|
})
|
||||||
|
|
||||||
}(window.jQuery);
|
}(window.jQuery);
|
1
js/bootstrap-popover.js
vendored
1
js/bootstrap-popover.js
vendored
@@ -95,6 +95,7 @@
|
|||||||
|
|
||||||
$.fn.popover.defaults = $.extend({} , $.fn.tooltip.defaults, {
|
$.fn.popover.defaults = $.extend({} , $.fn.tooltip.defaults, {
|
||||||
placement: 'right'
|
placement: 'right'
|
||||||
|
, trigger: 'click'
|
||||||
, content: ''
|
, content: ''
|
||||||
, template: '<div class="popover"><div class="arrow"></div><div class="popover-inner"><h3 class="popover-title"></h3><div class="popover-content"><p></p></div></div></div>'
|
, template: '<div class="popover"><div class="arrow"></div><div class="popover-inner"><h3 class="popover-title"></h3><div class="popover-content"><p></p></div></div></div>'
|
||||||
})
|
})
|
||||||
|
6
js/bootstrap-tooltip.js
vendored
6
js/bootstrap-tooltip.js
vendored
@@ -44,8 +44,10 @@
|
|||||||
this.options = this.getOptions(options)
|
this.options = this.getOptions(options)
|
||||||
this.enabled = true
|
this.enabled = true
|
||||||
|
|
||||||
if (this.options.trigger != 'manual') {
|
if (this.options.trigger == 'click') {
|
||||||
eventIn = this.options.trigger == 'hover' ? 'mouseenter' : 'focus'
|
this.$element.on('click.' + this.type, this.options.selector, $.proxy(this.toggle, this))
|
||||||
|
} else if (this.options.trigger != 'manual') {
|
||||||
|
eventIn = this.options.trigger == 'hover' ? 'mouseenter' : 'focus'
|
||||||
eventOut = this.options.trigger == 'hover' ? 'mouseleave' : 'blur'
|
eventOut = this.options.trigger == 'hover' ? 'mouseleave' : 'blur'
|
||||||
this.$element.on(eventIn + '.' + this.type, this.options.selector, $.proxy(this.enter, this))
|
this.$element.on(eventIn + '.' + this.type, this.options.selector, $.proxy(this.enter, this))
|
||||||
this.$element.on(eventOut + '.' + this.type, this.options.selector, $.proxy(this.leave, this))
|
this.$element.on(eventOut + '.' + this.type, this.options.selector, $.proxy(this.leave, this))
|
||||||
|
2
js/tests/unit/bootstrap-popover.js
vendored
2
js/tests/unit/bootstrap-popover.js
vendored
@@ -92,7 +92,7 @@ $(function () {
|
|||||||
})
|
})
|
||||||
|
|
||||||
test("should destroy popover", function () {
|
test("should destroy popover", function () {
|
||||||
var popover = $('<div/>').popover().on('click.foo', function(){})
|
var popover = $('<div/>').popover({trigger: 'hover'}).on('click.foo', function(){})
|
||||||
ok(popover.data('popover'), 'popover has data')
|
ok(popover.data('popover'), 'popover has data')
|
||||||
ok(popover.data('events').mouseover && popover.data('events').mouseout, 'popover has hover event')
|
ok(popover.data('events').mouseover && popover.data('events').mouseout, 'popover has hover event')
|
||||||
ok(popover.data('events').click[0].namespace == 'foo', 'popover has extra click.foo event')
|
ok(popover.data('events').click[0].namespace == 'foo', 'popover has extra click.foo event')
|
||||||
|
Reference in New Issue
Block a user