diff options
Diffstat (limited to 'dist/js/bootstrap.js')
-rw-r--r-- | dist/js/bootstrap.js | 126 |
1 files changed, 71 insertions, 55 deletions
diff --git a/dist/js/bootstrap.js b/dist/js/bootstrap.js index b3252968bd..8066073bc4 100644 --- a/dist/js/bootstrap.js +++ b/dist/js/bootstrap.js @@ -1,5 +1,5 @@ /*! - * Bootstrap v3.4.0 (http://getbootstrap.com) + * Bootstrap v3.4.0 (https://getbootstrap.com/) * Copyright 2011-2018 Twitter, Inc. * Licensed under the MIT license */ @@ -18,9 +18,9 @@ if (typeof jQuery === 'undefined') { /* ======================================================================== * Bootstrap: transition.js v3.4.0 - * http://getbootstrap.com/javascript/#transitions + * https://getbootstrap.com/docs/3.4/javascript/#transitions * ======================================================================== - * Copyright 2011-2016 Twitter, Inc. + * Copyright 2011-2018 Twitter, Inc. * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) * ======================================================================== */ @@ -28,7 +28,7 @@ if (typeof jQuery === 'undefined') { +function ($) { 'use strict'; - // CSS TRANSITION SUPPORT (Shoutout: http://www.modernizr.com/) + // CSS TRANSITION SUPPORT (Shoutout: https://modernizr.com/) // ============================================================ function transitionEnd() { @@ -50,7 +50,7 @@ if (typeof jQuery === 'undefined') { return false // explicit for ie8 ( ._.) } - // http://blog.alexmaccaw.com/css-transitions + // https://blog.alexmaccaw.com/css-transitions $.fn.emulateTransitionEnd = function (duration) { var called = false var $el = this @@ -78,9 +78,9 @@ if (typeof jQuery === 'undefined') { /* ======================================================================== * Bootstrap: alert.js v3.4.0 - * http://getbootstrap.com/javascript/#alerts + * https://getbootstrap.com/docs/3.4/javascript/#alerts * ======================================================================== - * Copyright 2011-2016 Twitter, Inc. + * Copyright 2011-2018 Twitter, Inc. * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) * ======================================================================== */ @@ -174,9 +174,9 @@ if (typeof jQuery === 'undefined') { /* ======================================================================== * Bootstrap: button.js v3.4.0 - * http://getbootstrap.com/javascript/#buttons + * https://getbootstrap.com/docs/3.4/javascript/#buttons * ======================================================================== - * Copyright 2011-2016 Twitter, Inc. + * Copyright 2011-2018 Twitter, Inc. * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) * ======================================================================== */ @@ -300,9 +300,9 @@ if (typeof jQuery === 'undefined') { /* ======================================================================== * Bootstrap: carousel.js v3.4.0 - * http://getbootstrap.com/javascript/#carousel + * https://getbootstrap.com/docs/3.4/javascript/#carousel * ======================================================================== - * Copyright 2011-2016 Twitter, Inc. + * Copyright 2011-2018 Twitter, Inc. * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) * ======================================================================== */ @@ -547,9 +547,9 @@ if (typeof jQuery === 'undefined') { /* ======================================================================== * Bootstrap: collapse.js v3.4.0 - * http://getbootstrap.com/javascript/#collapse + * https://getbootstrap.com/docs/3.4/javascript/#collapse * ======================================================================== - * Copyright 2011-2016 Twitter, Inc. + * Copyright 2011-2018 Twitter, Inc. * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) * ======================================================================== */ @@ -760,9 +760,9 @@ if (typeof jQuery === 'undefined') { /* ======================================================================== * Bootstrap: dropdown.js v3.4.0 - * http://getbootstrap.com/javascript/#dropdowns + * https://getbootstrap.com/docs/3.4/javascript/#dropdowns * ======================================================================== - * Copyright 2011-2016 Twitter, Inc. + * Copyright 2011-2018 Twitter, Inc. * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) * ======================================================================== */ @@ -926,9 +926,9 @@ if (typeof jQuery === 'undefined') { /* ======================================================================== * Bootstrap: modal.js v3.4.0 - * http://getbootstrap.com/javascript/#modals + * https://getbootstrap.com/docs/3.4/javascript/#modals * ======================================================================== - * Copyright 2011-2016 Twitter, Inc. + * Copyright 2011-2018 Twitter, Inc. * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) * ======================================================================== */ @@ -940,15 +940,16 @@ if (typeof jQuery === 'undefined') { // ====================== var Modal = function (element, options) { - this.options = options - this.$body = $(document.body) - this.$element = $(element) - this.$dialog = this.$element.find('.modal-dialog') - this.$backdrop = null - this.isShown = null - this.originalBodyPad = null - this.scrollbarWidth = 0 + this.options = options + this.$body = $(document.body) + this.$element = $(element) + this.$dialog = this.$element.find('.modal-dialog') + this.$backdrop = null + this.isShown = null + this.originalBodyPad = null + this.scrollbarWidth = 0 this.ignoreBackdropClick = false + this.fixedContent = '.navbar-fixed-top, .navbar-fixed-bottom' if (this.options.remote) { this.$element @@ -959,7 +960,7 @@ if (typeof jQuery === 'undefined') { } } - Modal.VERSION = '3.4.0' + Modal.VERSION = '3.4.0' Modal.TRANSITION_DURATION = 300 Modal.BACKDROP_TRANSITION_DURATION = 150 @@ -976,7 +977,7 @@ if (typeof jQuery === 'undefined') { Modal.prototype.show = function (_relatedTarget) { var that = this - var e = $.Event('show.bs.modal', { relatedTarget: _relatedTarget }) + var e = $.Event('show.bs.modal', { relatedTarget: _relatedTarget }) this.$element.trigger(e) @@ -1067,8 +1068,8 @@ if (typeof jQuery === 'undefined') { .off('focusin.bs.modal') // guard against infinite focus loop .on('focusin.bs.modal', $.proxy(function (e) { if (document !== e.target && - this.$element[0] !== e.target && - !this.$element.has(e.target).length) { + this.$element[0] !== e.target && + !this.$element.has(e.target).length) { this.$element.trigger('focus') } }, this)) @@ -1170,7 +1171,7 @@ if (typeof jQuery === 'undefined') { var modalIsOverflowing = this.$element[0].scrollHeight > document.documentElement.clientHeight this.$element.css({ - paddingLeft: !this.bodyIsOverflowing && modalIsOverflowing ? this.scrollbarWidth : '', + paddingLeft: !this.bodyIsOverflowing && modalIsOverflowing ? this.scrollbarWidth : '', paddingRight: this.bodyIsOverflowing && !modalIsOverflowing ? this.scrollbarWidth : '' }) } @@ -1195,11 +1196,26 @@ if (typeof jQuery === 'undefined') { Modal.prototype.setScrollbar = function () { var bodyPad = parseInt((this.$body.css('padding-right') || 0), 10) this.originalBodyPad = document.body.style.paddingRight || '' - if (this.bodyIsOverflowing) this.$body.css('padding-right', bodyPad + this.scrollbarWidth) + var scrollbarWidth = this.scrollbarWidth + if (this.bodyIsOverflowing) { + this.$body.css('padding-right', bodyPad + scrollbarWidth) + $(this.fixedContent).each(function (index, element) { + var actualPadding = element.style.paddingRight + var calculatedPadding = $(element).css('padding-right') + $(element) + .data('padding-right', actualPadding) + .css('padding-right', parseFloat(calculatedPadding) + scrollbarWidth + 'px') + }) + } } Modal.prototype.resetScrollbar = function () { this.$body.css('padding-right', this.originalBodyPad) + $(this.fixedContent).each(function (index, element) { + var padding = $(element).data('padding-right') + $(element).removeData('padding-right') + element.style.paddingRight = padding ? padding : '' + }) } Modal.prototype.measureScrollbar = function () { // thx walsh @@ -1217,8 +1233,8 @@ if (typeof jQuery === 'undefined') { function Plugin(option, _relatedTarget) { return this.each(function () { - var $this = $(this) - var data = $this.data('bs.modal') + var $this = $(this) + var data = $this.data('bs.modal') var options = $.extend({}, Modal.DEFAULTS, $this.data(), typeof option == 'object' && option) if (!data) $this.data('bs.modal', (data = new Modal(this, options))) @@ -1229,7 +1245,7 @@ if (typeof jQuery === 'undefined') { var old = $.fn.modal - $.fn.modal = Plugin + $.fn.modal = Plugin $.fn.modal.Constructor = Modal @@ -1246,13 +1262,13 @@ if (typeof jQuery === 'undefined') { // ============== $(document).on('click.bs.modal.data-api', '[data-toggle="modal"]', function (e) { - var $this = $(this) - var href = $this.attr('href') - var target = $this.attr('data-target') || + var $this = $(this) + var href = $this.attr('href') + var target = $this.attr('data-target') || (href && href.replace(/.*(?=#[^\s]+$)/, '')) // strip for ie7 var $target = $(document).find(target) - var option = $target.data('bs.modal') ? 'toggle' : $.extend({ remote: !/#/.test(href) && href }, $target.data(), $this.data()) + var option = $target.data('bs.modal') ? 'toggle' : $.extend({ remote: !/#/.test(href) && href }, $target.data(), $this.data()) if ($this.is('a')) e.preventDefault() @@ -1269,10 +1285,10 @@ if (typeof jQuery === 'undefined') { /* ======================================================================== * Bootstrap: tooltip.js v3.4.0 - * http://getbootstrap.com/javascript/#tooltip + * https://getbootstrap.com/docs/3.4/javascript/#tooltip * Inspired by the original jQuery.tipsy by Jason Frame * ======================================================================== - * Copyright 2011-2016 Twitter, Inc. + * Copyright 2011-2018 Twitter, Inc. * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) * ======================================================================== */ @@ -1790,9 +1806,9 @@ if (typeof jQuery === 'undefined') { /* ======================================================================== * Bootstrap: popover.js v3.4.0 - * http://getbootstrap.com/javascript/#popovers + * https://getbootstrap.com/docs/3.4/javascript/#popovers * ======================================================================== - * Copyright 2011-2016 Twitter, Inc. + * Copyright 2011-2018 Twitter, Inc. * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) * ======================================================================== */ @@ -1857,8 +1873,8 @@ if (typeof jQuery === 'undefined') { return $e.attr('data-content') || (typeof o.content == 'function' ? - o.content.call($e[0]) : - o.content) + o.content.call($e[0]) : + o.content) } Popover.prototype.arrow = function () { @@ -1899,9 +1915,9 @@ if (typeof jQuery === 'undefined') { /* ======================================================================== * Bootstrap: scrollspy.js v3.4.0 - * http://getbootstrap.com/javascript/#scrollspy + * https://getbootstrap.com/docs/3.4/javascript/#scrollspy * ======================================================================== - * Copyright 2011-2016 Twitter, Inc. + * Copyright 2011-2018 Twitter, Inc. * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) * ======================================================================== */ @@ -2072,9 +2088,9 @@ if (typeof jQuery === 'undefined') { /* ======================================================================== * Bootstrap: tab.js v3.4.0 - * http://getbootstrap.com/javascript/#tabs + * https://getbootstrap.com/docs/3.4/javascript/#tabs * ======================================================================== - * Copyright 2011-2016 Twitter, Inc. + * Copyright 2011-2018 Twitter, Inc. * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) * ======================================================================== */ @@ -2145,15 +2161,15 @@ if (typeof jQuery === 'undefined') { $active .removeClass('active') .find('> .dropdown-menu > .active') - .removeClass('active') + .removeClass('active') .end() .find('[data-toggle="tab"]') - .attr('aria-expanded', false) + .attr('aria-expanded', false) element .addClass('active') .find('[data-toggle="tab"]') - .attr('aria-expanded', true) + .attr('aria-expanded', true) if (transition) { element[0].offsetWidth // reflow for transition @@ -2165,10 +2181,10 @@ if (typeof jQuery === 'undefined') { if (element.parent('.dropdown-menu').length) { element .closest('li.dropdown') - .addClass('active') + .addClass('active') .end() .find('[data-toggle="tab"]') - .attr('aria-expanded', true) + .attr('aria-expanded', true) } callback && callback() @@ -2228,9 +2244,9 @@ if (typeof jQuery === 'undefined') { /* ======================================================================== * Bootstrap: affix.js v3.4.0 - * http://getbootstrap.com/javascript/#affix + * https://getbootstrap.com/docs/3.4/javascript/#affix * ======================================================================== - * Copyright 2011-2016 Twitter, Inc. + * Copyright 2011-2018 Twitter, Inc. * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) * ======================================================================== */ |