diff options
| author | Mark Otto <[email protected]> | 2014-03-16 20:38:12 -0700 |
|---|---|---|
| committer | Mark Otto <[email protected]> | 2014-03-16 20:38:12 -0700 |
| commit | c93c3714336ecefdb69b4dc7ebc40ea87eb40a36 (patch) | |
| tree | c0ff88481a1977781b0826bd56a0a0fd080ba2e3 /js | |
| parent | b004c9ac393671489720be06739f01e5c1bec7fe (diff) | |
| parent | 96525fdec431f8d654ce0ea9b4f92c2a3ef9104b (diff) | |
| download | bootstrap-c93c3714336ecefdb69b4dc7ebc40ea87eb40a36.tar.xz bootstrap-c93c3714336ecefdb69b4dc7ebc40ea87eb40a36.zip | |
Merge branch 'master' of github.com:twbs/bootstrap
Diffstat (limited to 'js')
| -rw-r--r-- | js/affix.js | 4 | ||||
| -rw-r--r-- | js/modal.js | 2 | ||||
| -rw-r--r-- | js/scrollspy.js | 4 | ||||
| -rw-r--r-- | js/tooltip.js | 2 |
4 files changed, 5 insertions, 7 deletions
diff --git a/js/affix.js b/js/affix.js index 84953c5cd..7d36fff0b 100644 --- a/js/affix.js +++ b/js/affix.js @@ -55,8 +55,6 @@ var offsetTop = offset.top var offsetBottom = offset.bottom - if (this.affixed == 'top') position.top += scrollTop - if (typeof offset != 'object') offsetBottom = offsetTop = offset if (typeof offsetTop == 'function') offsetTop = offset.top(this.$element) if (typeof offsetBottom == 'function') offsetBottom = offset.bottom(this.$element) @@ -84,7 +82,7 @@ .trigger($.Event(affixType.replace('affix', 'affixed'))) if (affix == 'bottom') { - this.$element.offset({ top: scrollHeight - offsetBottom - this.$element.height() }) + this.$element.offset({ top: position.top }) } } diff --git a/js/modal.js b/js/modal.js index 454d7d57a..ec358696f 100644 --- a/js/modal.js +++ b/js/modal.js @@ -36,7 +36,7 @@ } Modal.prototype.toggle = function (_relatedTarget) { - return this[!this.isShown ? 'show' : 'hide'](_relatedTarget) + return this.isShown ? this.hide() : this.show(_relatedTarget) } Modal.prototype.show = function (_relatedTarget) { diff --git a/js/scrollspy.js b/js/scrollspy.js index fc907f11b..137bd373f 100644 --- a/js/scrollspy.js +++ b/js/scrollspy.js @@ -19,7 +19,7 @@ this.$element = $(element).is('body') ? $(window) : $(element) this.$body = $('body') - this.$scrollElement = this.$element.on('scroll.bs.scroll-spy.data-api', process) + this.$scrollElement = this.$element.on('scroll.bs.scrollspy', process) this.options = $.extend({}, ScrollSpy.DEFAULTS, options) this.selector = (this.options.target || ((href = $(element).attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '')) //strip for ie7 @@ -143,7 +143,7 @@ // SCROLLSPY DATA-API // ================== - $(window).on('load', function () { + $(window).on('load.bs.scrollspy.data-api', function () { $('[data-spy="scroll"]').each(function () { var $spy = $(this) $spy.scrollspy($spy.data()) diff --git a/js/tooltip.js b/js/tooltip.js index 7b75d7939..eb7875c9f 100644 --- a/js/tooltip.js +++ b/js/tooltip.js @@ -160,7 +160,7 @@ var $parent = this.$element.parent() var orgPlacement = placement - var docScroll = document.documentElement.scrollTop || document.body.scrollTop + var docScroll = document.documentElement.scrollTop var parentWidth = this.options.container == 'body' ? window.innerWidth : $parent.outerWidth() var parentHeight = this.options.container == 'body' ? window.innerHeight : $parent.outerHeight() var parentLeft = this.options.container == 'body' ? 0 : $parent.offset().left |
