aboutsummaryrefslogtreecommitdiff
path: root/docs/dist/js/bootstrap.js
diff options
context:
space:
mode:
authorMark Otto <[email protected]>2014-07-06 15:08:37 -0700
committerMark Otto <[email protected]>2014-07-06 15:08:37 -0700
commit354d4236688c5370cc345bbbde8cb5ef917ff2a1 (patch)
treed1393d7c8adc3691bdbf6e6e3d9ea5425b74d549 /docs/dist/js/bootstrap.js
parentac18e5811d136c22d7f46d06f97bcc12ee0f665f (diff)
downloadbootstrap-354d4236688c5370cc345bbbde8cb5ef917ff2a1.tar.xz
bootstrap-354d4236688c5370cc345bbbde8cb5ef917ff2a1.zip
grunt
Diffstat (limited to 'docs/dist/js/bootstrap.js')
-rw-r--r--docs/dist/js/bootstrap.js28
1 files changed, 17 insertions, 11 deletions
diff --git a/docs/dist/js/bootstrap.js b/docs/dist/js/bootstrap.js
index 6e2697214..42e6edc48 100644
--- a/docs/dist/js/bootstrap.js
+++ b/docs/dist/js/bootstrap.js
@@ -584,8 +584,7 @@ if (typeof jQuery === 'undefined') { throw new Error('Bootstrap\'s JavaScript re
this.$element
.addClass('collapsing')
- .removeClass('collapse')
- .removeClass('in')
+ .removeClass('collapse in')
this.transitioning = 1
@@ -657,7 +656,7 @@ if (typeof jQuery === 'undefined') { throw new Error('Bootstrap\'s JavaScript re
if (!data || !data.transitioning) {
if ($parent) $parent.find('[data-toggle="collapse"][data-parent="' + parent + '"]').not($this).addClass('collapsed')
- $this[$target.hasClass('in') ? 'addClass' : 'removeClass']('collapsed')
+ $this.toggleClass('collapsed', $target.hasClass('in'))
}
Plugin.call($target, option)
@@ -954,11 +953,11 @@ if (typeof jQuery === 'undefined') { throw new Error('Bootstrap\'s JavaScript re
Modal.prototype.escape = function () {
if (this.isShown && this.options.keyboard) {
- this.$element.on('keyup.dismiss.bs.modal', $.proxy(function (e) {
+ this.$element.on('keydown.dismiss.bs.modal', $.proxy(function (e) {
e.which == 27 && this.hide()
}, this))
} else if (!this.isShown) {
- this.$element.off('keyup.dismiss.bs.modal')
+ this.$element.off('keydown.dismiss.bs.modal')
}
}
@@ -985,7 +984,7 @@ if (typeof jQuery === 'undefined') { throw new Error('Bootstrap\'s JavaScript re
this.$backdrop = $('<div class="modal-backdrop ' + animate + '" />')
.appendTo(this.$body)
- this.$element.on('click.dismiss.bs.modal', $.proxy(function (e) {
+ this.$element.on('mousedown.dismiss.bs.modal', $.proxy(function (e) {
if (e.target !== e.currentTarget) return
this.options.backdrop == 'static'
? this.$element[0].focus.call(this.$element[0])
@@ -1416,13 +1415,20 @@ if (typeof jQuery === 'undefined') { throw new Error('Bootstrap\'s JavaScript re
Tooltip.prototype.getPosition = function ($element) {
$element = $element || this.$element
+
var el = $element[0]
var isBody = el.tagName == 'BODY'
- return $.extend({}, (typeof el.getBoundingClientRect == 'function') ? el.getBoundingClientRect() : null, {
- scroll: isBody ? document.documentElement.scrollTop || document.body.scrollTop : $element.scrollTop(),
+ var isSvg = window.SVGElement && el instanceof window.SVGElement
+
+ var elRect = typeof el.getBoundingClientRect == 'function' ? el.getBoundingClientRect() : null
+ var elOffset = isBody ? { top: 0, left: 0 } : $element.offset()
+ var scroll = { scroll: isBody ? document.documentElement.scrollTop || document.body.scrollTop : $element.scrollTop() }
+ var outerDims = isSvg ? {} : {
width: isBody ? $(window).width() : $element.outerWidth(),
height: isBody ? $(window).height() : $element.outerHeight()
- }, isBody ? { top: 0, left: 0 } : $element.offset())
+ }
+
+ return $.extend({}, elRect, scroll, outerDims, elOffset)
}
Tooltip.prototype.getCalculatedOffset = function (placement, pos, actualWidth, actualHeight) {
@@ -1898,7 +1904,7 @@ if (typeof jQuery === 'undefined') { throw new Error('Bootstrap\'s JavaScript re
var $active = container.find('> .active')
var transition = callback
&& $.support.transition
- && $active.hasClass('fade')
+ && (($active.length && $active.hasClass('fade')) || !!container.find('> .fade').length)
function next() {
$active
@@ -1922,7 +1928,7 @@ if (typeof jQuery === 'undefined') { throw new Error('Bootstrap\'s JavaScript re
callback && callback()
}
- transition ?
+ $active.length && transition ?
$active
.one('bsTransitionEnd', next)
.emulateTransitionEnd(150) :