1
0
mirror of https://github.com/twbs/bootstrap.git synced 2025-08-06 21:56:42 +02:00

Minor style tweaks.

This commit is contained in:
XhmikosR
2014-05-29 07:35:22 +03:00
parent 82fc03f3b6
commit e2cabe4971
8 changed files with 30 additions and 20 deletions

View File

@@ -80,8 +80,7 @@ window.onload = function () { // wait for load in a dumb way because B-0
.error(function (err) { .error(function (err) {
try { try {
showError('<strong>Ruh roh!</strong> Could not save gist file, configuration not saved.', err) showError('<strong>Ruh roh!</strong> Could not save gist file, configuration not saved.', err)
} } catch (sameErr) {
catch (sameErr) {
// deliberately ignore the error // deliberately ignore the error
} }
callback('<none>', '<none>') callback('<none>', '<none>')
@@ -416,8 +415,7 @@ window.onload = function () { // wait for load in a dumb way because B-0
// than "blob:", which means it has been polyfilled and is not supported by // than "blob:", which means it has been polyfilled and is not supported by
// this browser. // this browser.
failback() failback()
} } else {
else {
$('<img>') $('<img>')
.on('load', function () { .on('load', function () {
$compileBtn.prop('disabled', false) $compileBtn.prop('disabled', false)

View File

@@ -86,7 +86,9 @@
.trigger($.Event(affixType.replace('affix', 'affixed'))) .trigger($.Event(affixType.replace('affix', 'affixed')))
if (affix == 'bottom') { if (affix == 'bottom') {
this.$element.offset({ top: scrollHeight - this.$element.height() - offsetBottom }) this.$element.offset({
top: scrollHeight - this.$element.height() - offsetBottom
})
} }
} }

View File

@@ -106,7 +106,10 @@
if ($next.hasClass('active')) return (this.sliding = false) if ($next.hasClass('active')) return (this.sliding = false)
var relatedTarget = $next[0] var relatedTarget = $next[0]
var slideEvent = $.Event('slide.bs.carousel', { relatedTarget: relatedTarget, direction: direction }) var slideEvent = $.Event('slide.bs.carousel', {
relatedTarget: relatedTarget,
direction: direction
})
this.$element.trigger(slideEvent) this.$element.trigger(slideEvent)
if (slideEvent.isDefaultPrevented()) return if (slideEvent.isDefaultPrevented()) return
@@ -133,7 +136,9 @@
$next.removeClass([type, direction].join(' ')).addClass('active') $next.removeClass([type, direction].join(' ')).addClass('active')
$active.removeClass(['active', direction].join(' ')) $active.removeClass(['active', direction].join(' '))
that.sliding = false that.sliding = false
setTimeout(function () { that.$element.trigger(slidEvent) }, 0) setTimeout(function () {
that.$element.trigger(slidEvent)
}, 0)
}) })
.emulateTransitionEnd($active.css('transition-duration').slice(0, -1) * 1000) .emulateTransitionEnd($active.css('transition-duration').slice(0, -1) * 1000)
} else { } else {

View File

@@ -54,7 +54,9 @@ $(function () {
setTimeout(function () { setTimeout(function () {
window.scrollTo(0, document.body.scrollHeight) window.scrollTo(0, document.body.scrollHeight)
setTimeout(function () { window.scroll(0, 0) }, 0) setTimeout(function () {
window.scroll(0, 0)
}, 0)
}, 0) }, 0)
}) })
}) })

View File

@@ -167,7 +167,9 @@ $(function () {
}) })
test('should destroy popover', function () { test('should destroy popover', function () {
var popover = $('<div/>').bootstrapPopover({ trigger: 'hover' }).on('click.foo', function () {}) var popover = $('<div/>').bootstrapPopover({
trigger: 'hover'
}).on('click.foo', function () {})
ok(popover.data('bs.popover'), 'popover has data') ok(popover.data('bs.popover'), 'popover has data')
ok($._data(popover[0], 'events').mouseover && $._data(popover[0], 'events').mouseout, 'popover has hover event') ok($._data(popover[0], 'events').mouseover && $._data(popover[0], 'events').mouseout, 'popover has hover event')
ok($._data(popover[0], 'events').click[0].namespace == 'foo', 'popover has extra click.foo event') ok($._data(popover[0], 'events').click[0].namespace == 'foo', 'popover has extra click.foo event')

View File

@@ -312,8 +312,9 @@ $(function () {
test('should show tooltip with delegate selector on click', function () { test('should show tooltip with delegate selector on click', function () {
var div = $('<div><a href="#" rel="tooltip" title="Another tooltip"></a></div>') var div = $('<div><a href="#" rel="tooltip" title="Another tooltip"></a></div>')
div.appendTo('#qunit-fixture') div.appendTo('#qunit-fixture').bootstrapTooltip({
.bootstrapTooltip({ selector: 'a[rel="tooltip"]', trigger: 'click' }) selector: 'a[rel="tooltip"]', trigger: 'click'
})
div.find('a').trigger('click') div.find('a').trigger('click')
ok($('.tooltip').is('.fade.in'), 'tooltip is faded in') ok($('.tooltip').is('.fade.in'), 'tooltip is faded in')
}) })