mirror of
https://github.com/twbs/bootstrap.git
synced 2024-12-01 13:24:25 +01:00
parent
2ee9b2717b
commit
117f65d431
4
docs/templates/pages/javascript.mustache
vendored
4
docs/templates/pages/javascript.mustache
vendored
@ -786,7 +786,7 @@ $('a[data-toggle="tab"]').on('shown', function (e) {
|
||||
<p>{{_i}}Toggles an element's tooltip.{{/i}}</p>
|
||||
<pre class="prettyprint linenums">$('#element').tooltip('toggle')</pre>
|
||||
<h4>.tooltip('destroy')</h4>
|
||||
<p>{{_i}}Destroys an element's tooltip.{{/i}}</p>
|
||||
<p>{{_i}}Hides and destroys an element's tooltip.{{/i}}</p>
|
||||
<pre class="prettyprint linenums">$('#element').tooltip('destroy')</pre>
|
||||
</section>
|
||||
|
||||
@ -947,7 +947,7 @@ $('a[data-toggle="tab"]').on('shown', function (e) {
|
||||
<p>{{_i}}Toggles an elements popover.{{/i}}</p>
|
||||
<pre class="prettyprint linenums">$('#element').popover('toggle')</pre>
|
||||
<h4>.popover('destroy')</h4>
|
||||
<p>{{_i}}Destroys an element's popover.{{/i}}</p>
|
||||
<p>{{_i}}Hides and destroys an element's popover.{{/i}}</p>
|
||||
<pre class="prettyprint linenums">$('#element').popover('destroy')</pre>
|
||||
</section>
|
||||
|
||||
|
1
js/bootstrap-popover.js
vendored
1
js/bootstrap-popover.js
vendored
@ -72,6 +72,7 @@
|
||||
}
|
||||
|
||||
, destroy: function () {
|
||||
this.hide()
|
||||
this.$element.off(this.options.ns).removeData('popover')
|
||||
}
|
||||
|
||||
|
1
js/bootstrap-tooltip.js
vendored
1
js/bootstrap-tooltip.js
vendored
@ -236,6 +236,7 @@
|
||||
}
|
||||
|
||||
, destroy: function () {
|
||||
this.hide()
|
||||
this.$element.off(this.options.ns).removeData('tooltip')
|
||||
}
|
||||
|
||||
|
2
js/tests/unit/bootstrap-popover.js
vendored
2
js/tests/unit/bootstrap-popover.js
vendored
@ -96,7 +96,9 @@ $(function () {
|
||||
ok(popover.data('popover'), 'popover has data')
|
||||
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')
|
||||
popover.popover('show')
|
||||
popover.popover('destroy')
|
||||
ok(!popover.hasClass('in'), 'popover is hidden')
|
||||
ok(!popover.data('popover'), 'popover does not have data')
|
||||
ok(popover.data('events').click[0].namespace == 'foo', 'popover still has click.foo')
|
||||
ok(!popover.data('events').mouseover && !popover.data('events').mouseout, 'popover does not have any events')
|
||||
|
2
js/tests/unit/bootstrap-tooltip.js
vendored
2
js/tests/unit/bootstrap-tooltip.js
vendored
@ -133,7 +133,9 @@ $(function () {
|
||||
ok(tooltip.data('tooltip'), 'tooltip has data')
|
||||
ok(tooltip.data('events').mouseover && tooltip.data('events').mouseout, 'tooltip has hover event')
|
||||
ok(tooltip.data('events').click[0].namespace == 'foo', 'tooltip has extra click.foo event')
|
||||
tooltip.tooltip('show')
|
||||
tooltip.tooltip('destroy')
|
||||
ok(!tooltip.hasClass('in'), 'tooltip is hidden')
|
||||
ok(!tooltip.data('tooltip'), 'tooltip does not have data')
|
||||
ok(tooltip.data('events').click[0].namespace == 'foo', 'tooltip still has click.foo')
|
||||
ok(!tooltip.data('events').mouseover && !tooltip.data('events').mouseout, 'tooltip does not have any events')
|
||||
|
Loading…
Reference in New Issue
Block a user