diff options
Diffstat (limited to 'dist/js/bootstrap.js')
| -rw-r--r-- | dist/js/bootstrap.js | 50 |
1 files changed, 38 insertions, 12 deletions
diff --git a/dist/js/bootstrap.js b/dist/js/bootstrap.js index 886209b31..02cbb5c1c 100644 --- a/dist/js/bootstrap.js +++ b/dist/js/bootstrap.js @@ -75,6 +75,8 @@ if (typeof jQuery === 'undefined') { throw new Error('Bootstrap\'s JavaScript re $(el).on('click', dismiss, this.close) } + Alert.VERSION = '3.1.1' + Alert.prototype.close = function (e) { var $this = $(this) var selector = $this.attr('data-target') @@ -99,7 +101,8 @@ if (typeof jQuery === 'undefined') { throw new Error('Bootstrap\'s JavaScript re $parent.removeClass('in') function removeElement() { - $parent.trigger('closed.bs.alert').remove() + // detach from parent, fire event then clean up data + $parent.detach().trigger('closed.bs.alert').remove() } $.support.transition && $parent.hasClass('fade') ? @@ -166,6 +169,8 @@ if (typeof jQuery === 'undefined') { throw new Error('Bootstrap\'s JavaScript re this.isLoading = false } + Button.VERSION = '3.1.1' + Button.DEFAULTS = { loadingText: 'loading...' } @@ -178,9 +183,9 @@ if (typeof jQuery === 'undefined') { throw new Error('Bootstrap\'s JavaScript re state = state + 'Text' - if (!data.resetText) $el.data('resetText', $el[val]()) + if (data.resetText == null) $el.data('resetText', $el[val]()) - $el[val](data[state] || this.options[state]) + $el[val](data[state] == null ? this.options[state] : data[state]) // push to event loop to allow forms to submit setTimeout($.proxy(function () { @@ -284,6 +289,8 @@ if (typeof jQuery === 'undefined') { throw new Error('Bootstrap\'s JavaScript re .on('mouseleave', $.proxy(this.cycle, this)) } + Carousel.VERSION = '3.1.1' + Carousel.DEFAULTS = { interval: 5000, pause: 'hover', @@ -487,6 +494,8 @@ if (typeof jQuery === 'undefined') { throw new Error('Bootstrap\'s JavaScript re if (this.options.toggle) this.toggle() } + Collapse.VERSION = '3.1.1' + Collapse.DEFAULTS = { toggle: true } @@ -663,6 +672,8 @@ if (typeof jQuery === 'undefined') { throw new Error('Bootstrap\'s JavaScript re $(element).on('click.bs.dropdown', this.toggle) } + Dropdown.VERSION = '3.1.1' + Dropdown.prototype.toggle = function (e) { var $this = $(this) @@ -824,6 +835,8 @@ if (typeof jQuery === 'undefined') { throw new Error('Bootstrap\'s JavaScript re } } + Modal.VERSION = '3.1.1' + Modal.DEFAULTS = { backdrop: true, keyboard: true, @@ -1061,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') }) }) @@ -1095,6 +1108,8 @@ if (typeof jQuery === 'undefined') { throw new Error('Bootstrap\'s JavaScript re this.init('tooltip', element, options) } + Tooltip.VERSION = '3.1.1' + Tooltip.DEFAULTS = { animation: true, placement: 'top', @@ -1531,11 +1546,13 @@ if (typeof jQuery === 'undefined') { throw new Error('Bootstrap\'s JavaScript re if (!$.fn.tooltip) throw new Error('Popover requires tooltip.js') + Popover.VERSION = '3.1.1' + Popover.DEFAULTS = $.extend({}, $.fn.tooltip.Constructor.DEFAULTS, { placement: 'right', trigger: 'click', content: '', - template: '<div class="popover"><div class="arrow"></div><h3 class="popover-title"></h3><div class="popover-content"></div></div>' + template: '<div class="popover" role="tooltip"><div class="arrow"></div><h3 class="popover-title"></h3><div class="popover-content"></div></div>' }) @@ -1656,6 +1673,8 @@ if (typeof jQuery === 'undefined') { throw new Error('Bootstrap\'s JavaScript re this.process() } + ScrollSpy.VERSION = '3.1.1' + ScrollSpy.DEFAULTS = { offset: 10 } @@ -1670,6 +1689,7 @@ if (typeof jQuery === 'undefined') { throw new Error('Bootstrap\'s JavaScript re this.$body .find(this.selector) + .filter(':visible') .map(function () { var $el = $(this) var href = $el.data('target') || $el.attr('href') @@ -1797,6 +1817,8 @@ if (typeof jQuery === 'undefined') { throw new Error('Bootstrap\'s JavaScript re this.element = $(element) } + Tab.VERSION = '3.1.1' + Tab.prototype.show = function () { var $this = this.element var $ul = $this.closest('ul:not(.dropdown-menu)') @@ -1820,7 +1842,7 @@ if (typeof jQuery === 'undefined') { throw new Error('Bootstrap\'s JavaScript re var $target = $(selector) - this.activate($this.parent('li'), $ul) + this.activate($this.closest('li'), $ul) this.activate($target, $target.parent(), function () { $this.trigger({ type: 'shown.bs.tab', @@ -1922,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)) @@ -1934,16 +1957,19 @@ if (typeof jQuery === 'undefined') { throw new Error('Bootstrap\'s JavaScript re this.checkPosition() } - Affix.RESET = 'affix affix-top affix-bottom' + Affix.VERSION = '3.1.1' + + 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) } @@ -1956,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 @@ -1989,7 +2015,7 @@ if (typeof jQuery === 'undefined') { throw new Error('Bootstrap\'s JavaScript re .trigger($.Event(affixType.replace('affix', 'affixed'))) if (affix == 'bottom') { - this.$element.offset({ top: position.top }) + this.$element.offset({ top: scrollHeight - this.$element.height() - offsetBottom }) } } |
