mirror of
https://github.com/twbs/bootstrap.git
synced 2025-01-18 10:52:19 +01:00
Minor indentation fixes.
This commit is contained in:
parent
b8a6855a69
commit
5cce25d515
@ -67,8 +67,8 @@
|
||||
|
||||
return $e.attr('data-content')
|
||||
|| (typeof o.content == 'function' ?
|
||||
o.content.call($e[0]) :
|
||||
o.content)
|
||||
o.content.call($e[0]) :
|
||||
o.content)
|
||||
}
|
||||
|
||||
Popover.prototype.arrow = function () {
|
||||
|
10
js/tab.js
10
js/tab.js
@ -73,15 +73,15 @@
|
||||
$active
|
||||
.removeClass('active')
|
||||
.find('> .dropdown-menu > .active')
|
||||
.removeClass('active')
|
||||
.removeClass('active')
|
||||
.end()
|
||||
.find('[data-toggle="tab"]')
|
||||
.attr('aria-expanded', false)
|
||||
.attr('aria-expanded', false)
|
||||
|
||||
element
|
||||
.addClass('active')
|
||||
.find('[data-toggle="tab"]')
|
||||
.attr('aria-expanded', true)
|
||||
.attr('aria-expanded', true)
|
||||
|
||||
if (transition) {
|
||||
element[0].offsetWidth // reflow for transition
|
||||
@ -93,10 +93,10 @@
|
||||
if (element.parent('.dropdown-menu').length) {
|
||||
element
|
||||
.closest('li.dropdown')
|
||||
.addClass('active')
|
||||
.addClass('active')
|
||||
.end()
|
||||
.find('[data-toggle="tab"]')
|
||||
.attr('aria-expanded', true)
|
||||
.attr('aria-expanded', true)
|
||||
}
|
||||
|
||||
callback && callback()
|
||||
|
@ -95,17 +95,17 @@ $(function () {
|
||||
|
||||
$(dropHTML)
|
||||
.find('ul > li:first a')
|
||||
.bootstrapTab('show')
|
||||
.bootstrapTab('show')
|
||||
.end()
|
||||
.find('ul > li:last a')
|
||||
.on('show.bs.tab', function (e) {
|
||||
assert.strictEqual(e.relatedTarget.hash, '#1-1', 'references correct element as relatedTarget')
|
||||
})
|
||||
.on('shown.bs.tab', function (e) {
|
||||
assert.strictEqual(e.relatedTarget.hash, '#1-1', 'references correct element as relatedTarget')
|
||||
done()
|
||||
})
|
||||
.bootstrapTab('show')
|
||||
.on('show.bs.tab', function (e) {
|
||||
assert.strictEqual(e.relatedTarget.hash, '#1-1', 'references correct element as relatedTarget')
|
||||
})
|
||||
.on('shown.bs.tab', function (e) {
|
||||
assert.strictEqual(e.relatedTarget.hash, '#1-1', 'references correct element as relatedTarget')
|
||||
done()
|
||||
})
|
||||
.bootstrapTab('show')
|
||||
})
|
||||
|
||||
QUnit.test('should fire hide and hidden events', function (assert) {
|
||||
@ -119,24 +119,24 @@ $(function () {
|
||||
|
||||
$(tabsHTML)
|
||||
.find('li:first a')
|
||||
.on('hide.bs.tab', function () {
|
||||
assert.ok(true, 'hide event fired')
|
||||
})
|
||||
.bootstrapTab('show')
|
||||
.on('hide.bs.tab', function () {
|
||||
assert.ok(true, 'hide event fired')
|
||||
})
|
||||
.bootstrapTab('show')
|
||||
.end()
|
||||
.find('li:last a')
|
||||
.bootstrapTab('show')
|
||||
.bootstrapTab('show')
|
||||
|
||||
$(tabsHTML)
|
||||
.find('li:first a')
|
||||
.on('hidden.bs.tab', function () {
|
||||
assert.ok(true, 'hidden event fired')
|
||||
done()
|
||||
})
|
||||
.bootstrapTab('show')
|
||||
.on('hidden.bs.tab', function () {
|
||||
assert.ok(true, 'hidden event fired')
|
||||
done()
|
||||
})
|
||||
.bootstrapTab('show')
|
||||
.end()
|
||||
.find('li:last a')
|
||||
.bootstrapTab('show')
|
||||
.bootstrapTab('show')
|
||||
})
|
||||
|
||||
QUnit.test('should not fire hidden when hide is prevented', function (assert) {
|
||||
@ -150,18 +150,18 @@ $(function () {
|
||||
|
||||
$(tabsHTML)
|
||||
.find('li:first a')
|
||||
.on('hide.bs.tab', function (e) {
|
||||
e.preventDefault()
|
||||
assert.ok(true, 'hide event fired')
|
||||
done()
|
||||
})
|
||||
.on('hidden.bs.tab', function () {
|
||||
assert.ok(false, 'hidden event fired')
|
||||
})
|
||||
.bootstrapTab('show')
|
||||
.on('hide.bs.tab', function (e) {
|
||||
e.preventDefault()
|
||||
assert.ok(true, 'hide event fired')
|
||||
done()
|
||||
})
|
||||
.on('hidden.bs.tab', function () {
|
||||
assert.ok(false, 'hidden event fired')
|
||||
})
|
||||
.bootstrapTab('show')
|
||||
.end()
|
||||
.find('li:last a')
|
||||
.bootstrapTab('show')
|
||||
.bootstrapTab('show')
|
||||
})
|
||||
|
||||
QUnit.test('hide and hidden events contain correct relatedTarget', function (assert) {
|
||||
@ -175,17 +175,17 @@ $(function () {
|
||||
|
||||
$(tabsHTML)
|
||||
.find('li:first a')
|
||||
.on('hide.bs.tab', function (e) {
|
||||
assert.strictEqual(e.relatedTarget.hash, '#profile', 'references correct element as relatedTarget')
|
||||
})
|
||||
.on('hidden.bs.tab', function (e) {
|
||||
assert.strictEqual(e.relatedTarget.hash, '#profile', 'references correct element as relatedTarget')
|
||||
done()
|
||||
})
|
||||
.bootstrapTab('show')
|
||||
.on('hide.bs.tab', function (e) {
|
||||
assert.strictEqual(e.relatedTarget.hash, '#profile', 'references correct element as relatedTarget')
|
||||
})
|
||||
.on('hidden.bs.tab', function (e) {
|
||||
assert.strictEqual(e.relatedTarget.hash, '#profile', 'references correct element as relatedTarget')
|
||||
done()
|
||||
})
|
||||
.bootstrapTab('show')
|
||||
.end()
|
||||
.find('li:last a')
|
||||
.bootstrapTab('show')
|
||||
.bootstrapTab('show')
|
||||
})
|
||||
|
||||
QUnit.test('selected tab should have aria-expanded', function (assert) {
|
||||
|
@ -495,8 +495,8 @@ $(function () {
|
||||
|
||||
function rightTooltip() {
|
||||
var $rightTooltip = $('<div style="right: 0;" rel="tooltip" title="Right tooltip">Right Dynamic Tooltip</div>')
|
||||
.appendTo($container)
|
||||
.bootstrapTooltip({ placement: 'right auto', viewport: '#qunit-fixture' })
|
||||
.appendTo($container)
|
||||
.bootstrapTooltip({ placement: 'right auto', viewport: '#qunit-fixture' })
|
||||
|
||||
$rightTooltip
|
||||
.one('shown.bs.tooltip', function () {
|
||||
@ -1258,7 +1258,7 @@ $(function () {
|
||||
var $styles = $(styles).appendTo('head')
|
||||
|
||||
$('#qunit-fixture').append(
|
||||
'<div style="position: fixed; top: 0; left: 0;">'
|
||||
'<div style="position: fixed; top: 0; left: 0;">'
|
||||
+ ' <svg width="200" height="200">'
|
||||
+ ' <circle cx="100" cy="100" r="10" title="m" id="theCircle" />'
|
||||
+ ' </svg>'
|
||||
@ -1500,28 +1500,28 @@ $(function () {
|
||||
function showingTooltip() { return $tooltip.hasClass('in') || tooltip.hoverState == 'in' }
|
||||
|
||||
var tests = [
|
||||
['mouseenter', 'mouseleave'],
|
||||
['mouseenter', 'mouseleave'],
|
||||
|
||||
['focusin', 'focusout'],
|
||||
['focusin', 'focusout'],
|
||||
|
||||
['click', 'click'],
|
||||
['click', 'click'],
|
||||
|
||||
['mouseenter', 'focusin', 'focusout', 'mouseleave'],
|
||||
['mouseenter', 'focusin', 'mouseleave', 'focusout'],
|
||||
['mouseenter', 'focusin', 'focusout', 'mouseleave'],
|
||||
['mouseenter', 'focusin', 'mouseleave', 'focusout'],
|
||||
|
||||
['focusin', 'mouseenter', 'mouseleave', 'focusout'],
|
||||
['focusin', 'mouseenter', 'focusout', 'mouseleave'],
|
||||
['focusin', 'mouseenter', 'mouseleave', 'focusout'],
|
||||
['focusin', 'mouseenter', 'focusout', 'mouseleave'],
|
||||
|
||||
['click', 'focusin', 'mouseenter', 'focusout', 'mouseleave', 'click'],
|
||||
['mouseenter', 'click', 'focusin', 'focusout', 'mouseleave', 'click'],
|
||||
['mouseenter', 'focusin', 'click', 'click', 'mouseleave', 'focusout']
|
||||
['click', 'focusin', 'mouseenter', 'focusout', 'mouseleave', 'click'],
|
||||
['mouseenter', 'click', 'focusin', 'focusout', 'mouseleave', 'click'],
|
||||
['mouseenter', 'focusin', 'click', 'click', 'mouseleave', 'focusout']
|
||||
]
|
||||
|
||||
assert.ok(!showingTooltip())
|
||||
|
||||
$.each(tests, function (idx, triggers) {
|
||||
for (var i = 0, len = triggers.length; i < len; i++) {
|
||||
$el.trigger(triggers[i]);
|
||||
$el.trigger(triggers[i])
|
||||
assert.equal(i < (len - 1), showingTooltip())
|
||||
}
|
||||
})
|
||||
|
Loading…
x
Reference in New Issue
Block a user