diff options
| author | Mark Otto <[email protected]> | 2014-05-22 23:01:42 -0700 |
|---|---|---|
| committer | Mark Otto <[email protected]> | 2014-05-22 23:01:42 -0700 |
| commit | d66b65ddde1b2f1a5cb14f601d30c552c79d7626 (patch) | |
| tree | d7f07c493e959cebd256939bf28bcbf4af468a28 /dist/js/bootstrap.js | |
| parent | 91d51d3fba1cc2f80138bb2858ce67c28c9c8a89 (diff) | |
| parent | 10e9fef85c6afde2b3804df928d9351b0f110a6c (diff) | |
| download | bootstrap-d66b65ddde1b2f1a5cb14f601d30c552c79d7626.tar.xz bootstrap-d66b65ddde1b2f1a5cb14f601d30c552c79d7626.zip | |
Merge branch 'master' into icon_paths
Conflicts:
dist/css/bootstrap.css.map
docs/dist/css/bootstrap.css.map
Diffstat (limited to 'dist/js/bootstrap.js')
| -rw-r--r-- | dist/js/bootstrap.js | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/dist/js/bootstrap.js b/dist/js/bootstrap.js index ea770c956..02cbb5c1c 100644 --- a/dist/js/bootstrap.js +++ b/dist/js/bootstrap.js @@ -1074,7 +1074,7 @@ if (typeof jQuery === 'undefined') { throw new Error('Bootstrap\'s JavaScript re if ($this.is('a')) e.preventDefault() Plugin.call($target, option, this) - $target.one('hide', function () { + $target.one('hide.bs.modal', function () { $this.is(':visible') && $this.trigger('focus') }) }) @@ -1944,7 +1944,8 @@ if (typeof jQuery === 'undefined') { throw new Error('Bootstrap\'s JavaScript re var Affix = function (element, options) { this.options = $.extend({}, Affix.DEFAULTS, options) - this.$window = $(window) + + this.$target = $(this.options.target) .on('scroll.bs.affix.data-api', $.proxy(this.checkPosition, this)) .on('click.bs.affix.data-api', $.proxy(this.checkPositionWithEventLoop, this)) @@ -1961,13 +1962,14 @@ if (typeof jQuery === 'undefined') { throw new Error('Bootstrap\'s JavaScript re Affix.RESET = 'affix affix-top affix-bottom' Affix.DEFAULTS = { - offset: 0 + offset: 0, + target: window } Affix.prototype.getPinnedOffset = function () { if (this.pinnedOffset) return this.pinnedOffset this.$element.removeClass(Affix.RESET).addClass('affix') - var scrollTop = this.$window.scrollTop() + var scrollTop = this.$target.scrollTop() var position = this.$element.offset() return (this.pinnedOffset = position.top - scrollTop) } @@ -1980,7 +1982,7 @@ if (typeof jQuery === 'undefined') { throw new Error('Bootstrap\'s JavaScript re if (!this.$element.is(':visible')) return var scrollHeight = $(document).height() - var scrollTop = this.$window.scrollTop() + var scrollTop = this.$target.scrollTop() var position = this.$element.offset() var offset = this.options.offset var offsetTop = offset.top |
