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