diff options
Diffstat (limited to 'dist/js/bootstrap.js')
-rw-r--r-- | dist/js/bootstrap.js | 551 |
1 files changed, 326 insertions, 225 deletions
diff --git a/dist/js/bootstrap.js b/dist/js/bootstrap.js index 8dff365f..8a2e99a5 100644 --- a/dist/js/bootstrap.js +++ b/dist/js/bootstrap.js | |||
@@ -1,7 +1,7 @@ | |||
1 | /*! | 1 | /*! |
2 | * Bootstrap v3.3.0 (http://getbootstrap.com) | 2 | * Bootstrap v3.3.7 (http://getbootstrap.com) |
3 | * Copyright 2011-2014 Twitter, Inc. | 3 | * Copyright 2011-2016 Twitter, Inc. |
4 | * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) | 4 | * Licensed under the MIT license |
5 | */ | 5 | */ |
6 | 6 | ||
7 | if (typeof jQuery === 'undefined') { | 7 | if (typeof jQuery === 'undefined') { |
@@ -9,17 +9,18 @@ if (typeof jQuery === 'undefined') { | |||
9 | } | 9 | } |
10 | 10 | ||
11 | +function ($) { | 11 | +function ($) { |
12 | 'use strict'; | ||
12 | var version = $.fn.jquery.split(' ')[0].split('.') | 13 | var version = $.fn.jquery.split(' ')[0].split('.') |
13 | if ((version[0] < 2 && version[1] < 9) || (version[0] == 1 && version[1] == 9 && version[2] < 1)) { | 14 | if ((version[0] < 2 && version[1] < 9) || (version[0] == 1 && version[1] == 9 && version[2] < 1) || (version[0] > 3)) { |
14 | throw new Error('Bootstrap\'s JavaScript requires jQuery version 1.9.1 or higher') | 15 | throw new Error('Bootstrap\'s JavaScript requires jQuery version 1.9.1 or higher, but lower than version 4') |
15 | } | 16 | } |
16 | }(jQuery); | 17 | }(jQuery); |
17 | 18 | ||
18 | /* ======================================================================== | 19 | /* ======================================================================== |
19 | * Bootstrap: transition.js v3.3.0 | 20 | * Bootstrap: transition.js v3.3.7 |
20 | * http://getbootstrap.com/javascript/#transitions | 21 | * http://getbootstrap.com/javascript/#transitions |
21 | * ======================================================================== | 22 | * ======================================================================== |
22 | * Copyright 2011-2014 Twitter, Inc. | 23 | * Copyright 2011-2016 Twitter, Inc. |
23 | * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) | 24 | * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) |
24 | * ======================================================================== */ | 25 | * ======================================================================== */ |
25 | 26 | ||
@@ -76,10 +77,10 @@ if (typeof jQuery === 'undefined') { | |||
76 | }(jQuery); | 77 | }(jQuery); |
77 | 78 | ||
78 | /* ======================================================================== | 79 | /* ======================================================================== |
79 | * Bootstrap: alert.js v3.3.0 | 80 | * Bootstrap: alert.js v3.3.7 |
80 | * http://getbootstrap.com/javascript/#alerts | 81 | * http://getbootstrap.com/javascript/#alerts |
81 | * ======================================================================== | 82 | * ======================================================================== |
82 | * Copyright 2011-2014 Twitter, Inc. | 83 | * Copyright 2011-2016 Twitter, Inc. |
83 | * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) | 84 | * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) |
84 | * ======================================================================== */ | 85 | * ======================================================================== */ |
85 | 86 | ||
@@ -95,7 +96,7 @@ if (typeof jQuery === 'undefined') { | |||
95 | $(el).on('click', dismiss, this.close) | 96 | $(el).on('click', dismiss, this.close) |
96 | } | 97 | } |
97 | 98 | ||
98 | Alert.VERSION = '3.3.0' | 99 | Alert.VERSION = '3.3.7' |
99 | 100 | ||
100 | Alert.TRANSITION_DURATION = 150 | 101 | Alert.TRANSITION_DURATION = 150 |
101 | 102 | ||
@@ -108,7 +109,7 @@ if (typeof jQuery === 'undefined') { | |||
108 | selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') // strip for ie7 | 109 | selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') // strip for ie7 |
109 | } | 110 | } |
110 | 111 | ||
111 | var $parent = $(selector) | 112 | var $parent = $(selector === '#' ? [] : selector) |
112 | 113 | ||
113 | if (e) e.preventDefault() | 114 | if (e) e.preventDefault() |
114 | 115 | ||
@@ -171,10 +172,10 @@ if (typeof jQuery === 'undefined') { | |||
171 | }(jQuery); | 172 | }(jQuery); |
172 | 173 | ||
173 | /* ======================================================================== | 174 | /* ======================================================================== |
174 | * Bootstrap: button.js v3.3.0 | 175 | * Bootstrap: button.js v3.3.7 |
175 | * http://getbootstrap.com/javascript/#buttons | 176 | * http://getbootstrap.com/javascript/#buttons |
176 | * ======================================================================== | 177 | * ======================================================================== |
177 | * Copyright 2011-2014 Twitter, Inc. | 178 | * Copyright 2011-2016 Twitter, Inc. |
178 | * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) | 179 | * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) |
179 | * ======================================================================== */ | 180 | * ======================================================================== */ |
180 | 181 | ||
@@ -191,7 +192,7 @@ if (typeof jQuery === 'undefined') { | |||
191 | this.isLoading = false | 192 | this.isLoading = false |
192 | } | 193 | } |
193 | 194 | ||
194 | Button.VERSION = '3.3.0' | 195 | Button.VERSION = '3.3.7' |
195 | 196 | ||
196 | Button.DEFAULTS = { | 197 | Button.DEFAULTS = { |
197 | loadingText: 'loading...' | 198 | loadingText: 'loading...' |
@@ -203,7 +204,7 @@ if (typeof jQuery === 'undefined') { | |||
203 | var val = $el.is('input') ? 'val' : 'html' | 204 | var val = $el.is('input') ? 'val' : 'html' |
204 | var data = $el.data() | 205 | var data = $el.data() |
205 | 206 | ||
206 | state = state + 'Text' | 207 | state += 'Text' |
207 | 208 | ||
208 | if (data.resetText == null) $el.data('resetText', $el[val]()) | 209 | if (data.resetText == null) $el.data('resetText', $el[val]()) |
209 | 210 | ||
@@ -213,10 +214,10 @@ if (typeof jQuery === 'undefined') { | |||
213 | 214 | ||
214 | if (state == 'loadingText') { | 215 | if (state == 'loadingText') { |
215 | this.isLoading = true | 216 | this.isLoading = true |
216 | $el.addClass(d).attr(d, d) | 217 | $el.addClass(d).attr(d, d).prop(d, true) |
217 | } else if (this.isLoading) { | 218 | } else if (this.isLoading) { |
218 | this.isLoading = false | 219 | this.isLoading = false |
219 | $el.removeClass(d).removeAttr(d) | 220 | $el.removeClass(d).removeAttr(d).prop(d, false) |
220 | } | 221 | } |
221 | }, this), 0) | 222 | }, this), 0) |
222 | } | 223 | } |
@@ -228,15 +229,19 @@ if (typeof jQuery === 'undefined') { | |||
228 | if ($parent.length) { | 229 | if ($parent.length) { |
229 | var $input = this.$element.find('input') | 230 | var $input = this.$element.find('input') |
230 | if ($input.prop('type') == 'radio') { | 231 | if ($input.prop('type') == 'radio') { |
231 | if ($input.prop('checked') && this.$element.hasClass('active')) changed = false | 232 | if ($input.prop('checked')) changed = false |
232 | else $parent.find('.active').removeClass('active') | 233 | $parent.find('.active').removeClass('active') |
234 | this.$element.addClass('active') | ||
235 | } else if ($input.prop('type') == 'checkbox') { | ||
236 | if (($input.prop('checked')) !== this.$element.hasClass('active')) changed = false | ||
237 | this.$element.toggleClass('active') | ||
233 | } | 238 | } |
234 | if (changed) $input.prop('checked', !this.$element.hasClass('active')).trigger('change') | 239 | $input.prop('checked', this.$element.hasClass('active')) |
240 | if (changed) $input.trigger('change') | ||
235 | } else { | 241 | } else { |
236 | this.$element.attr('aria-pressed', !this.$element.hasClass('active')) | 242 | this.$element.attr('aria-pressed', !this.$element.hasClass('active')) |
243 | this.$element.toggleClass('active') | ||
237 | } | 244 | } |
238 | |||
239 | if (changed) this.$element.toggleClass('active') | ||
240 | } | 245 | } |
241 | 246 | ||
242 | 247 | ||
@@ -276,22 +281,27 @@ if (typeof jQuery === 'undefined') { | |||
276 | 281 | ||
277 | $(document) | 282 | $(document) |
278 | .on('click.bs.button.data-api', '[data-toggle^="button"]', function (e) { | 283 | .on('click.bs.button.data-api', '[data-toggle^="button"]', function (e) { |
279 | var $btn = $(e.target) | 284 | var $btn = $(e.target).closest('.btn') |
280 | if (!$btn.hasClass('btn')) $btn = $btn.closest('.btn') | ||
281 | Plugin.call($btn, 'toggle') | 285 | Plugin.call($btn, 'toggle') |
282 | e.preventDefault() | 286 | if (!($(e.target).is('input[type="radio"], input[type="checkbox"]'))) { |
287 | // Prevent double click on radios, and the double selections (so cancellation) on checkboxes | ||
288 | e.preventDefault() | ||
289 | // The target component still receive the focus | ||
290 | if ($btn.is('input,button')) $btn.trigger('focus') | ||
291 | else $btn.find('input:visible,button:visible').first().trigger('focus') | ||
292 | } | ||
283 | }) | 293 | }) |
284 | .on('focus.bs.button.data-api blur.bs.button.data-api', '[data-toggle^="button"]', function (e) { | 294 | .on('focus.bs.button.data-api blur.bs.button.data-api', '[data-toggle^="button"]', function (e) { |
285 | $(e.target).closest('.btn').toggleClass('focus', e.type == 'focus') | 295 | $(e.target).closest('.btn').toggleClass('focus', /^focus(in)?$/.test(e.type)) |
286 | }) | 296 | }) |
287 | 297 | ||
288 | }(jQuery); | 298 | }(jQuery); |
289 | 299 | ||
290 | /* ======================================================================== | 300 | /* ======================================================================== |
291 | * Bootstrap: carousel.js v3.3.0 | 301 | * Bootstrap: carousel.js v3.3.7 |
292 | * http://getbootstrap.com/javascript/#carousel | 302 | * http://getbootstrap.com/javascript/#carousel |
293 | * ======================================================================== | 303 | * ======================================================================== |
294 | * Copyright 2011-2014 Twitter, Inc. | 304 | * Copyright 2011-2016 Twitter, Inc. |
295 | * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) | 305 | * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) |
296 | * ======================================================================== */ | 306 | * ======================================================================== */ |
297 | 307 | ||
@@ -306,10 +316,10 @@ if (typeof jQuery === 'undefined') { | |||
306 | this.$element = $(element) | 316 | this.$element = $(element) |
307 | this.$indicators = this.$element.find('.carousel-indicators') | 317 | this.$indicators = this.$element.find('.carousel-indicators') |
308 | this.options = options | 318 | this.options = options |
309 | this.paused = | 319 | this.paused = null |
310 | this.sliding = | 320 | this.sliding = null |
311 | this.interval = | 321 | this.interval = null |
312 | this.$active = | 322 | this.$active = null |
313 | this.$items = null | 323 | this.$items = null |
314 | 324 | ||
315 | this.options.keyboard && this.$element.on('keydown.bs.carousel', $.proxy(this.keydown, this)) | 325 | this.options.keyboard && this.$element.on('keydown.bs.carousel', $.proxy(this.keydown, this)) |
@@ -319,7 +329,7 @@ if (typeof jQuery === 'undefined') { | |||
319 | .on('mouseleave.bs.carousel', $.proxy(this.cycle, this)) | 329 | .on('mouseleave.bs.carousel', $.proxy(this.cycle, this)) |
320 | } | 330 | } |
321 | 331 | ||
322 | Carousel.VERSION = '3.3.0' | 332 | Carousel.VERSION = '3.3.7' |
323 | 333 | ||
324 | Carousel.TRANSITION_DURATION = 600 | 334 | Carousel.TRANSITION_DURATION = 600 |
325 | 335 | ||
@@ -331,6 +341,7 @@ if (typeof jQuery === 'undefined') { | |||
331 | } | 341 | } |
332 | 342 | ||
333 | Carousel.prototype.keydown = function (e) { | 343 | Carousel.prototype.keydown = function (e) { |
344 | if (/input|textarea/i.test(e.target.tagName)) return | ||
334 | switch (e.which) { | 345 | switch (e.which) { |
335 | case 37: this.prev(); break | 346 | case 37: this.prev(); break |
336 | case 39: this.next(); break | 347 | case 39: this.next(); break |
@@ -358,8 +369,11 @@ if (typeof jQuery === 'undefined') { | |||
358 | } | 369 | } |
359 | 370 | ||
360 | Carousel.prototype.getItemForDirection = function (direction, active) { | 371 | Carousel.prototype.getItemForDirection = function (direction, active) { |
361 | var delta = direction == 'prev' ? -1 : 1 | ||
362 | var activeIndex = this.getItemIndex(active) | 372 | var activeIndex = this.getItemIndex(active) |
373 | var willWrap = (direction == 'prev' && activeIndex === 0) | ||
374 | || (direction == 'next' && activeIndex == (this.$items.length - 1)) | ||
375 | if (willWrap && !this.options.wrap) return active | ||
376 | var delta = direction == 'prev' ? -1 : 1 | ||
363 | var itemIndex = (activeIndex + delta) % this.$items.length | 377 | var itemIndex = (activeIndex + delta) % this.$items.length |
364 | return this.$items.eq(itemIndex) | 378 | return this.$items.eq(itemIndex) |
365 | } | 379 | } |
@@ -404,14 +418,8 @@ if (typeof jQuery === 'undefined') { | |||
404 | var $next = next || this.getItemForDirection(type, $active) | 418 | var $next = next || this.getItemForDirection(type, $active) |
405 | var isCycling = this.interval | 419 | var isCycling = this.interval |
406 | var direction = type == 'next' ? 'left' : 'right' | 420 | var direction = type == 'next' ? 'left' : 'right' |
407 | var fallback = type == 'next' ? 'first' : 'last' | ||
408 | var that = this | 421 | var that = this |
409 | 422 | ||
410 | if (!$next.length) { | ||
411 | if (!this.options.wrap) return | ||
412 | $next = this.$element.find('.item')[fallback]() | ||
413 | } | ||
414 | |||
415 | if ($next.hasClass('active')) return (this.sliding = false) | 423 | if ($next.hasClass('active')) return (this.sliding = false) |
416 | 424 | ||
417 | var relatedTarget = $next[0] | 425 | var relatedTarget = $next[0] |
@@ -528,13 +536,14 @@ if (typeof jQuery === 'undefined') { | |||
528 | }(jQuery); | 536 | }(jQuery); |
529 | 537 | ||
530 | /* ======================================================================== | 538 | /* ======================================================================== |
531 | * Bootstrap: collapse.js v3.3.0 | 539 | * Bootstrap: collapse.js v3.3.7 |
532 | * http://getbootstrap.com/javascript/#collapse | 540 | * http://getbootstrap.com/javascript/#collapse |
533 | * ======================================================================== | 541 | * ======================================================================== |
534 | * Copyright 2011-2014 Twitter, Inc. | 542 | * Copyright 2011-2016 Twitter, Inc. |
535 | * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) | 543 | * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) |
536 | * ======================================================================== */ | 544 | * ======================================================================== */ |
537 | 545 | ||
546 | /* jshint latedef: false */ | ||
538 | 547 | ||
539 | +function ($) { | 548 | +function ($) { |
540 | 'use strict'; | 549 | 'use strict'; |
@@ -545,7 +554,8 @@ if (typeof jQuery === 'undefined') { | |||
545 | var Collapse = function (element, options) { | 554 | var Collapse = function (element, options) { |
546 | this.$element = $(element) | 555 | this.$element = $(element) |
547 | this.options = $.extend({}, Collapse.DEFAULTS, options) | 556 | this.options = $.extend({}, Collapse.DEFAULTS, options) |
548 | this.$trigger = $(this.options.trigger).filter('[href="#' + element.id + '"], [data-target="#' + element.id + '"]') | 557 | this.$trigger = $('[data-toggle="collapse"][href="#' + element.id + '"],' + |
558 | '[data-toggle="collapse"][data-target="#' + element.id + '"]') | ||
549 | this.transitioning = null | 559 | this.transitioning = null |
550 | 560 | ||
551 | if (this.options.parent) { | 561 | if (this.options.parent) { |
@@ -557,13 +567,12 @@ if (typeof jQuery === 'undefined') { | |||
557 | if (this.options.toggle) this.toggle() | 567 | if (this.options.toggle) this.toggle() |
558 | } | 568 | } |
559 | 569 | ||
560 | Collapse.VERSION = '3.3.0' | 570 | Collapse.VERSION = '3.3.7' |
561 | 571 | ||
562 | Collapse.TRANSITION_DURATION = 350 | 572 | Collapse.TRANSITION_DURATION = 350 |
563 | 573 | ||
564 | Collapse.DEFAULTS = { | 574 | Collapse.DEFAULTS = { |
565 | toggle: true, | 575 | toggle: true |
566 | trigger: '[data-toggle="collapse"]' | ||
567 | } | 576 | } |
568 | 577 | ||
569 | Collapse.prototype.dimension = function () { | 578 | Collapse.prototype.dimension = function () { |
@@ -575,7 +584,7 @@ if (typeof jQuery === 'undefined') { | |||
575 | if (this.transitioning || this.$element.hasClass('in')) return | 584 | if (this.transitioning || this.$element.hasClass('in')) return |
576 | 585 | ||
577 | var activesData | 586 | var activesData |
578 | var actives = this.$parent && this.$parent.find('> .panel').children('.in, .collapsing') | 587 | var actives = this.$parent && this.$parent.children('.panel').children('.in, .collapsing') |
579 | 588 | ||
580 | if (actives && actives.length) { | 589 | if (actives && actives.length) { |
581 | activesData = actives.data('bs.collapse') | 590 | activesData = actives.data('bs.collapse') |
@@ -701,7 +710,7 @@ if (typeof jQuery === 'undefined') { | |||
701 | var data = $this.data('bs.collapse') | 710 | var data = $this.data('bs.collapse') |
702 | var options = $.extend({}, Collapse.DEFAULTS, $this.data(), typeof option == 'object' && option) | 711 | var options = $.extend({}, Collapse.DEFAULTS, $this.data(), typeof option == 'object' && option) |
703 | 712 | ||
704 | if (!data && options.toggle && option == 'show') options.toggle = false | 713 | if (!data && options.toggle && /show|hide/.test(option)) options.toggle = false |
705 | if (!data) $this.data('bs.collapse', (data = new Collapse(this, options))) | 714 | if (!data) $this.data('bs.collapse', (data = new Collapse(this, options))) |
706 | if (typeof option == 'string') data[option]() | 715 | if (typeof option == 'string') data[option]() |
707 | }) | 716 | }) |
@@ -732,7 +741,7 @@ if (typeof jQuery === 'undefined') { | |||
732 | 741 | ||
733 | var $target = getTargetFromTrigger($this) | 742 | var $target = getTargetFromTrigger($this) |
734 | var data = $target.data('bs.collapse') | 743 | var data = $target.data('bs.collapse') |
735 | var option = data ? 'toggle' : $.extend({}, $this.data(), { trigger: this }) | 744 | var option = data ? 'toggle' : $this.data() |
736 | 745 | ||
737 | Plugin.call($target, option) | 746 | Plugin.call($target, option) |
738 | }) | 747 | }) |
@@ -740,10 +749,10 @@ if (typeof jQuery === 'undefined') { | |||
740 | }(jQuery); | 749 | }(jQuery); |
741 | 750 | ||
742 | /* ======================================================================== | 751 | /* ======================================================================== |
743 | * Bootstrap: dropdown.js v3.3.0 | 752 | * Bootstrap: dropdown.js v3.3.7 |
744 | * http://getbootstrap.com/javascript/#dropdowns | 753 | * http://getbootstrap.com/javascript/#dropdowns |
745 | * ======================================================================== | 754 | * ======================================================================== |
746 | * Copyright 2011-2014 Twitter, Inc. | 755 | * Copyright 2011-2016 Twitter, Inc. |
747 | * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) | 756 | * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) |
748 | * ======================================================================== */ | 757 | * ======================================================================== */ |
749 | 758 | ||
@@ -760,7 +769,41 @@ if (typeof jQuery === 'undefined') { | |||
760 | $(element).on('click.bs.dropdown', this.toggle) | 769 | $(element).on('click.bs.dropdown', this.toggle) |
761 | } | 770 | } |
762 | 771 | ||
763 | Dropdown.VERSION = '3.3.0' | 772 | Dropdown.VERSION = '3.3.7' |
773 | |||
774 | function getParent($this) { | ||
775 | var selector = $this.attr('data-target') | ||
776 | |||
777 | if (!selector) { | ||
778 | selector = $this.attr('href') | ||
779 | selector = selector && /#[A-Za-z]/.test(selector) && selector.replace(/.*(?=#[^\s]*$)/, '') // strip for ie7 | ||
780 | } | ||
781 | |||
782 | var $parent = selector && $(selector) | ||
783 | |||
784 | return $parent && $parent.length ? $parent : $this.parent() | ||
785 | } | ||
786 | |||
787 | function clearMenus(e) { | ||
788 | if (e && e.which === 3) return | ||
789 | $(backdrop).remove() | ||
790 | $(toggle).each(function () { | ||
791 | var $this = $(this) | ||
792 | var $parent = getParent($this) | ||
793 | var relatedTarget = { relatedTarget: this } | ||
794 | |||
795 | if (!$parent.hasClass('open')) return | ||
796 | |||
797 | if (e && e.type == 'click' && /input|textarea/i.test(e.target.tagName) && $.contains($parent[0], e.target)) return | ||
798 | |||
799 | $parent.trigger(e = $.Event('hide.bs.dropdown', relatedTarget)) | ||
800 | |||
801 | if (e.isDefaultPrevented()) return | ||
802 | |||
803 | $this.attr('aria-expanded', 'false') | ||
804 | $parent.removeClass('open').trigger($.Event('hidden.bs.dropdown', relatedTarget)) | ||
805 | }) | ||
806 | } | ||
764 | 807 | ||
765 | Dropdown.prototype.toggle = function (e) { | 808 | Dropdown.prototype.toggle = function (e) { |
766 | var $this = $(this) | 809 | var $this = $(this) |
@@ -775,7 +818,10 @@ if (typeof jQuery === 'undefined') { | |||
775 | if (!isActive) { | 818 | if (!isActive) { |
776 | if ('ontouchstart' in document.documentElement && !$parent.closest('.navbar-nav').length) { | 819 | if ('ontouchstart' in document.documentElement && !$parent.closest('.navbar-nav').length) { |
777 | // if mobile we use a backdrop because click events don't delegate | 820 | // if mobile we use a backdrop because click events don't delegate |
778 | $('<div class="dropdown-backdrop"/>').insertAfter($(this)).on('click', clearMenus) | 821 | $(document.createElement('div')) |
822 | .addClass('dropdown-backdrop') | ||
823 | .insertAfter($(this)) | ||
824 | .on('click', clearMenus) | ||
779 | } | 825 | } |
780 | 826 | ||
781 | var relatedTarget = { relatedTarget: this } | 827 | var relatedTarget = { relatedTarget: this } |
@@ -789,14 +835,14 @@ if (typeof jQuery === 'undefined') { | |||
789 | 835 | ||
790 | $parent | 836 | $parent |
791 | .toggleClass('open') | 837 | .toggleClass('open') |
792 | .trigger('shown.bs.dropdown', relatedTarget) | 838 | .trigger($.Event('shown.bs.dropdown', relatedTarget)) |
793 | } | 839 | } |
794 | 840 | ||
795 | return false | 841 | return false |
796 | } | 842 | } |
797 | 843 | ||
798 | Dropdown.prototype.keydown = function (e) { | 844 | Dropdown.prototype.keydown = function (e) { |
799 | if (!/(38|40|27|32)/.test(e.which)) return | 845 | if (!/(38|40|27|32)/.test(e.which) || /input|textarea/i.test(e.target.tagName)) return |
800 | 846 | ||
801 | var $this = $(this) | 847 | var $this = $(this) |
802 | 848 | ||
@@ -808,57 +854,25 @@ if (typeof jQuery === 'undefined') { | |||
808 | var $parent = getParent($this) | 854 | var $parent = getParent($this) |
809 | var isActive = $parent.hasClass('open') | 855 | var isActive = $parent.hasClass('open') |
810 | 856 | ||
811 | if ((!isActive && e.which != 27) || (isActive && e.which == 27)) { | 857 | if (!isActive && e.which != 27 || isActive && e.which == 27) { |
812 | if (e.which == 27) $parent.find(toggle).trigger('focus') | 858 | if (e.which == 27) $parent.find(toggle).trigger('focus') |
813 | return $this.trigger('click') | 859 | return $this.trigger('click') |
814 | } | 860 | } |
815 | 861 | ||
816 | var desc = ' li:not(.divider):visible a' | 862 | var desc = ' li:not(.disabled):visible a' |
817 | var $items = $parent.find('[role="menu"]' + desc + ', [role="listbox"]' + desc) | 863 | var $items = $parent.find('.dropdown-menu' + desc) |
818 | 864 | ||
819 | if (!$items.length) return | 865 | if (!$items.length) return |
820 | 866 | ||
821 | var index = $items.index(e.target) | 867 | var index = $items.index(e.target) |
822 | 868 | ||
823 | if (e.which == 38 && index > 0) index-- // up | 869 | if (e.which == 38 && index > 0) index-- // up |
824 | if (e.which == 40 && index < $items.length - 1) index++ // down | 870 | if (e.which == 40 && index < $items.length - 1) index++ // down |
825 | if (!~index) index = 0 | 871 | if (!~index) index = 0 |
826 | 872 | ||
827 | $items.eq(index).trigger('focus') | 873 | $items.eq(index).trigger('focus') |
828 | } | 874 | } |
829 | 875 | ||
830 | function clearMenus(e) { | ||
831 | if (e && e.which === 3) return | ||
832 | $(backdrop).remove() | ||
833 | $(toggle).each(function () { | ||
834 | var $this = $(this) | ||
835 | var $parent = getParent($this) | ||
836 | var relatedTarget = { relatedTarget: this } | ||
837 | |||
838 | if (!$parent.hasClass('open')) return | ||
839 | |||
840 | $parent.trigger(e = $.Event('hide.bs.dropdown', relatedTarget)) | ||
841 | |||
842 | if (e.isDefaultPrevented()) return | ||
843 | |||
844 | $this.attr('aria-expanded', 'false') | ||
845 | $parent.removeClass('open').trigger('hidden.bs.dropdown', relatedTarget) | ||
846 | }) | ||
847 | } | ||
848 | |||
849 | function getParent($this) { | ||
850 | var selector = $this.attr('data-target') | ||
851 | |||
852 | if (!selector) { | ||
853 | selector = $this.attr('href') | ||
854 | selector = selector && /#[A-Za-z]/.test(selector) && selector.replace(/.*(?=#[^\s]*$)/, '') // strip for ie7 | ||
855 | } | ||
856 | |||
857 | var $parent = selector && $(selector) | ||
858 | |||
859 | return $parent && $parent.length ? $parent : $this.parent() | ||
860 | } | ||
861 | |||
862 | 876 | ||
863 | // DROPDOWN PLUGIN DEFINITION | 877 | // DROPDOWN PLUGIN DEFINITION |
864 | // ========================== | 878 | // ========================== |
@@ -896,16 +910,15 @@ if (typeof jQuery === 'undefined') { | |||
896 | .on('click.bs.dropdown.data-api', '.dropdown form', function (e) { e.stopPropagation() }) | 910 | .on('click.bs.dropdown.data-api', '.dropdown form', function (e) { e.stopPropagation() }) |
897 | .on('click.bs.dropdown.data-api', toggle, Dropdown.prototype.toggle) | 911 | .on('click.bs.dropdown.data-api', toggle, Dropdown.prototype.toggle) |
898 | .on('keydown.bs.dropdown.data-api', toggle, Dropdown.prototype.keydown) | 912 | .on('keydown.bs.dropdown.data-api', toggle, Dropdown.prototype.keydown) |
899 | .on('keydown.bs.dropdown.data-api', '[role="menu"]', Dropdown.prototype.keydown) | 913 | .on('keydown.bs.dropdown.data-api', '.dropdown-menu', Dropdown.prototype.keydown) |
900 | .on('keydown.bs.dropdown.data-api', '[role="listbox"]', Dropdown.prototype.keydown) | ||
901 | 914 | ||
902 | }(jQuery); | 915 | }(jQuery); |
903 | 916 | ||
904 | /* ======================================================================== | 917 | /* ======================================================================== |
905 | * Bootstrap: modal.js v3.3.0 | 918 | * Bootstrap: modal.js v3.3.7 |
906 | * http://getbootstrap.com/javascript/#modals | 919 | * http://getbootstrap.com/javascript/#modals |
907 | * ======================================================================== | 920 | * ======================================================================== |
908 | * Copyright 2011-2014 Twitter, Inc. | 921 | * Copyright 2011-2016 Twitter, Inc. |
909 | * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) | 922 | * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) |
910 | * ======================================================================== */ | 923 | * ======================================================================== */ |
911 | 924 | ||
@@ -917,12 +930,15 @@ if (typeof jQuery === 'undefined') { | |||
917 | // ====================== | 930 | // ====================== |
918 | 931 | ||
919 | var Modal = function (element, options) { | 932 | var Modal = function (element, options) { |
920 | this.options = options | 933 | this.options = options |
921 | this.$body = $(document.body) | 934 | this.$body = $(document.body) |
922 | this.$element = $(element) | 935 | this.$element = $(element) |
923 | this.$backdrop = | 936 | this.$dialog = this.$element.find('.modal-dialog') |
924 | this.isShown = null | 937 | this.$backdrop = null |
925 | this.scrollbarWidth = 0 | 938 | this.isShown = null |
939 | this.originalBodyPad = null | ||
940 | this.scrollbarWidth = 0 | ||
941 | this.ignoreBackdropClick = false | ||
926 | 942 | ||
927 | if (this.options.remote) { | 943 | if (this.options.remote) { |
928 | this.$element | 944 | this.$element |
@@ -933,7 +949,7 @@ if (typeof jQuery === 'undefined') { | |||
933 | } | 949 | } |
934 | } | 950 | } |
935 | 951 | ||
936 | Modal.VERSION = '3.3.0' | 952 | Modal.VERSION = '3.3.7' |
937 | 953 | ||
938 | Modal.TRANSITION_DURATION = 300 | 954 | Modal.TRANSITION_DURATION = 300 |
939 | Modal.BACKDROP_TRANSITION_DURATION = 150 | 955 | Modal.BACKDROP_TRANSITION_DURATION = 150 |
@@ -959,13 +975,20 @@ if (typeof jQuery === 'undefined') { | |||
959 | this.isShown = true | 975 | this.isShown = true |
960 | 976 | ||
961 | this.checkScrollbar() | 977 | this.checkScrollbar() |
978 | this.setScrollbar() | ||
962 | this.$body.addClass('modal-open') | 979 | this.$body.addClass('modal-open') |
963 | 980 | ||
964 | this.setScrollbar() | ||
965 | this.escape() | 981 | this.escape() |
982 | this.resize() | ||
966 | 983 | ||
967 | this.$element.on('click.dismiss.bs.modal', '[data-dismiss="modal"]', $.proxy(this.hide, this)) | 984 | this.$element.on('click.dismiss.bs.modal', '[data-dismiss="modal"]', $.proxy(this.hide, this)) |
968 | 985 | ||
986 | this.$dialog.on('mousedown.dismiss.bs.modal', function () { | ||
987 | that.$element.one('mouseup.dismiss.bs.modal', function (e) { | ||
988 | if ($(e.target).is(that.$element)) that.ignoreBackdropClick = true | ||
989 | }) | ||
990 | }) | ||
991 | |||
969 | this.backdrop(function () { | 992 | this.backdrop(function () { |
970 | var transition = $.support.transition && that.$element.hasClass('fade') | 993 | var transition = $.support.transition && that.$element.hasClass('fade') |
971 | 994 | ||
@@ -977,20 +1000,20 @@ if (typeof jQuery === 'undefined') { | |||
977 | .show() | 1000 | .show() |
978 | .scrollTop(0) | 1001 | .scrollTop(0) |
979 | 1002 | ||
1003 | that.adjustDialog() | ||
1004 | |||
980 | if (transition) { | 1005 | if (transition) { |
981 | that.$element[0].offsetWidth // force reflow | 1006 | that.$element[0].offsetWidth // force reflow |
982 | } | 1007 | } |
983 | 1008 | ||
984 | that.$element | 1009 | that.$element.addClass('in') |
985 | .addClass('in') | ||
986 | .attr('aria-hidden', false) | ||
987 | 1010 | ||
988 | that.enforceFocus() | 1011 | that.enforceFocus() |
989 | 1012 | ||
990 | var e = $.Event('shown.bs.modal', { relatedTarget: _relatedTarget }) | 1013 | var e = $.Event('shown.bs.modal', { relatedTarget: _relatedTarget }) |
991 | 1014 | ||
992 | transition ? | 1015 | transition ? |
993 | that.$element.find('.modal-dialog') // wait for modal to slide in | 1016 | that.$dialog // wait for modal to slide in |
994 | .one('bsTransitionEnd', function () { | 1017 | .one('bsTransitionEnd', function () { |
995 | that.$element.trigger('focus').trigger(e) | 1018 | that.$element.trigger('focus').trigger(e) |
996 | }) | 1019 | }) |
@@ -1011,13 +1034,16 @@ if (typeof jQuery === 'undefined') { | |||
1011 | this.isShown = false | 1034 | this.isShown = false |
1012 | 1035 | ||
1013 | this.escape() | 1036 | this.escape() |
1037 | this.resize() | ||
1014 | 1038 | ||
1015 | $(document).off('focusin.bs.modal') | 1039 | $(document).off('focusin.bs.modal') |
1016 | 1040 | ||
1017 | this.$element | 1041 | this.$element |
1018 | .removeClass('in') | 1042 | .removeClass('in') |
1019 | .attr('aria-hidden', true) | ||
1020 | .off('click.dismiss.bs.modal') | 1043 | .off('click.dismiss.bs.modal') |
1044 | .off('mouseup.dismiss.bs.modal') | ||
1045 | |||
1046 | this.$dialog.off('mousedown.dismiss.bs.modal') | ||
1021 | 1047 | ||
1022 | $.support.transition && this.$element.hasClass('fade') ? | 1048 | $.support.transition && this.$element.hasClass('fade') ? |
1023 | this.$element | 1049 | this.$element |
@@ -1030,7 +1056,9 @@ if (typeof jQuery === 'undefined') { | |||
1030 | $(document) | 1056 | $(document) |
1031 | .off('focusin.bs.modal') // guard against infinite focus loop | 1057 | .off('focusin.bs.modal') // guard against infinite focus loop |
1032 | .on('focusin.bs.modal', $.proxy(function (e) { | 1058 | .on('focusin.bs.modal', $.proxy(function (e) { |
1033 | if (this.$element[0] !== e.target && !this.$element.has(e.target).length) { | 1059 | if (document !== e.target && |
1060 | this.$element[0] !== e.target && | ||
1061 | !this.$element.has(e.target).length) { | ||
1034 | this.$element.trigger('focus') | 1062 | this.$element.trigger('focus') |
1035 | } | 1063 | } |
1036 | }, this)) | 1064 | }, this)) |
@@ -1046,11 +1074,20 @@ if (typeof jQuery === 'undefined') { | |||
1046 | } | 1074 | } |
1047 | } | 1075 | } |
1048 | 1076 | ||
1077 | Modal.prototype.resize = function () { | ||
1078 | if (this.isShown) { | ||
1079 | $(window).on('resize.bs.modal', $.proxy(this.handleUpdate, this)) | ||
1080 | } else { | ||
1081 | $(window).off('resize.bs.modal') | ||
1082 | } | ||
1083 | } | ||
1084 | |||
1049 | Modal.prototype.hideModal = function () { | 1085 | Modal.prototype.hideModal = function () { |
1050 | var that = this | 1086 | var that = this |
1051 | this.$element.hide() | 1087 | this.$element.hide() |
1052 | this.backdrop(function () { | 1088 | this.backdrop(function () { |
1053 | that.$body.removeClass('modal-open') | 1089 | that.$body.removeClass('modal-open') |
1090 | that.resetAdjustments() | ||
1054 | that.resetScrollbar() | 1091 | that.resetScrollbar() |
1055 | that.$element.trigger('hidden.bs.modal') | 1092 | that.$element.trigger('hidden.bs.modal') |
1056 | }) | 1093 | }) |
@@ -1068,14 +1105,20 @@ if (typeof jQuery === 'undefined') { | |||
1068 | if (this.isShown && this.options.backdrop) { | 1105 | if (this.isShown && this.options.backdrop) { |
1069 | var doAnimate = $.support.transition && animate | 1106 | var doAnimate = $.support.transition && animate |
1070 | 1107 | ||
1071 | this.$backdrop = $('<div class="modal-backdrop ' + animate + '" />') | 1108 | this.$backdrop = $(document.createElement('div')) |
1072 | .prependTo(this.$element) | 1109 | .addClass('modal-backdrop ' + animate) |
1073 | .on('click.dismiss.bs.modal', $.proxy(function (e) { | 1110 | .appendTo(this.$body) |
1074 | if (e.target !== e.currentTarget) return | 1111 | |
1075 | this.options.backdrop == 'static' | 1112 | this.$element.on('click.dismiss.bs.modal', $.proxy(function (e) { |
1076 | ? this.$element[0].focus.call(this.$element[0]) | 1113 | if (this.ignoreBackdropClick) { |
1077 | : this.hide.call(this) | 1114 | this.ignoreBackdropClick = false |
1078 | }, this)) | 1115 | return |
1116 | } | ||
1117 | if (e.target !== e.currentTarget) return | ||
1118 | this.options.backdrop == 'static' | ||
1119 | ? this.$element[0].focus() | ||
1120 | : this.hide() | ||
1121 | }, this)) | ||
1079 | 1122 | ||
1080 | if (doAnimate) this.$backdrop[0].offsetWidth // force reflow | 1123 | if (doAnimate) this.$backdrop[0].offsetWidth // force reflow |
1081 | 1124 | ||
@@ -1107,21 +1150,49 @@ if (typeof jQuery === 'undefined') { | |||
1107 | } | 1150 | } |
1108 | } | 1151 | } |
1109 | 1152 | ||
1153 | // these following methods are used to handle overflowing modals | ||
1154 | |||
1155 | Modal.prototype.handleUpdate = function () { | ||
1156 | this.adjustDialog() | ||
1157 | } | ||
1158 | |||
1159 | Modal.prototype.adjustDialog = function () { | ||
1160 | var modalIsOverflowing = this.$element[0].scrollHeight > document.documentElement.clientHeight | ||
1161 | |||
1162 | this.$element.css({ | ||
1163 | paddingLeft: !this.bodyIsOverflowing && modalIsOverflowing ? this.scrollbarWidth : '', | ||
1164 | paddingRight: this.bodyIsOverflowing && !modalIsOverflowing ? this.scrollbarWidth : '' | ||
1165 | }) | ||
1166 | } | ||
1167 | |||
1168 | Modal.prototype.resetAdjustments = function () { | ||
1169 | this.$element.css({ | ||
1170 | paddingLeft: '', | ||
1171 | paddingRight: '' | ||
1172 | }) | ||
1173 | } | ||
1174 | |||
1110 | Modal.prototype.checkScrollbar = function () { | 1175 | Modal.prototype.checkScrollbar = function () { |
1176 | var fullWindowWidth = window.innerWidth | ||
1177 | if (!fullWindowWidth) { // workaround for missing window.innerWidth in IE8 | ||
1178 | var documentElementRect = document.documentElement.getBoundingClientRect() | ||
1179 | fullWindowWidth = documentElementRect.right - Math.abs(documentElementRect.left) | ||
1180 | } | ||
1181 | this.bodyIsOverflowing = document.body.clientWidth < fullWindowWidth | ||
1111 | this.scrollbarWidth = this.measureScrollbar() | 1182 | this.scrollbarWidth = this.measureScrollbar() |
1112 | } | 1183 | } |
1113 | 1184 | ||
1114 | Modal.prototype.setScrollbar = function () { | 1185 | Modal.prototype.setScrollbar = function () { |
1115 | var bodyPad = parseInt((this.$body.css('padding-right') || 0), 10) | 1186 | var bodyPad = parseInt((this.$body.css('padding-right') || 0), 10) |
1116 | if (this.scrollbarWidth) this.$body.css('padding-right', bodyPad + this.scrollbarWidth) | 1187 | this.originalBodyPad = document.body.style.paddingRight || '' |
1188 | if (this.bodyIsOverflowing) this.$body.css('padding-right', bodyPad + this.scrollbarWidth) | ||
1117 | } | 1189 | } |
1118 | 1190 | ||
1119 | Modal.prototype.resetScrollbar = function () { | 1191 | Modal.prototype.resetScrollbar = function () { |
1120 | this.$body.css('padding-right', '') | 1192 | this.$body.css('padding-right', this.originalBodyPad) |
1121 | } | 1193 | } |
1122 | 1194 | ||
1123 | Modal.prototype.measureScrollbar = function () { // thx walsh | 1195 | Modal.prototype.measureScrollbar = function () { // thx walsh |
1124 | if (document.body.clientWidth >= window.innerWidth) return 0 | ||
1125 | var scrollDiv = document.createElement('div') | 1196 | var scrollDiv = document.createElement('div') |
1126 | scrollDiv.className = 'modal-scrollbar-measure' | 1197 | scrollDiv.className = 'modal-scrollbar-measure' |
1127 | this.$body.append(scrollDiv) | 1198 | this.$body.append(scrollDiv) |
@@ -1184,11 +1255,11 @@ if (typeof jQuery === 'undefined') { | |||
1184 | }(jQuery); | 1255 | }(jQuery); |
1185 | 1256 | ||
1186 | /* ======================================================================== | 1257 | /* ======================================================================== |
1187 | * Bootstrap: tooltip.js v3.3.0 | 1258 | * Bootstrap: tooltip.js v3.3.7 |
1188 | * http://getbootstrap.com/javascript/#tooltip | 1259 | * http://getbootstrap.com/javascript/#tooltip |
1189 | * Inspired by the original jQuery.tipsy by Jason Frame | 1260 | * Inspired by the original jQuery.tipsy by Jason Frame |
1190 | * ======================================================================== | 1261 | * ======================================================================== |
1191 | * Copyright 2011-2014 Twitter, Inc. | 1262 | * Copyright 2011-2016 Twitter, Inc. |
1192 | * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) | 1263 | * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) |
1193 | * ======================================================================== */ | 1264 | * ======================================================================== */ |
1194 | 1265 | ||
@@ -1200,17 +1271,18 @@ if (typeof jQuery === 'undefined') { | |||
1200 | // =============================== | 1271 | // =============================== |
1201 | 1272 | ||
1202 | var Tooltip = function (element, options) { | 1273 | var Tooltip = function (element, options) { |
1203 | this.type = | 1274 | this.type = null |
1204 | this.options = | 1275 | this.options = null |
1205 | this.enabled = | 1276 | this.enabled = null |
1206 | this.timeout = | 1277 | this.timeout = null |
1207 | this.hoverState = | 1278 | this.hoverState = null |
1208 | this.$element = null | 1279 | this.$element = null |
1280 | this.inState = null | ||
1209 | 1281 | ||
1210 | this.init('tooltip', element, options) | 1282 | this.init('tooltip', element, options) |
1211 | } | 1283 | } |
1212 | 1284 | ||
1213 | Tooltip.VERSION = '3.3.0' | 1285 | Tooltip.VERSION = '3.3.7' |
1214 | 1286 | ||
1215 | Tooltip.TRANSITION_DURATION = 150 | 1287 | Tooltip.TRANSITION_DURATION = 150 |
1216 | 1288 | ||
@@ -1235,7 +1307,12 @@ if (typeof jQuery === 'undefined') { | |||
1235 | this.type = type | 1307 | this.type = type |
1236 | this.$element = $(element) | 1308 | this.$element = $(element) |
1237 | this.options = this.getOptions(options) | 1309 | this.options = this.getOptions(options) |
1238 | this.$viewport = this.options.viewport && $(this.options.viewport.selector || this.options.viewport) | 1310 | this.$viewport = this.options.viewport && $($.isFunction(this.options.viewport) ? this.options.viewport.call(this, this.$element) : (this.options.viewport.selector || this.options.viewport)) |
1311 | this.inState = { click: false, hover: false, focus: false } | ||
1312 | |||
1313 | if (this.$element[0] instanceof document.constructor && !this.options.selector) { | ||
1314 | throw new Error('`selector` option must be specified when initializing ' + this.type + ' on the window.document object!') | ||
1315 | } | ||
1239 | 1316 | ||
1240 | var triggers = this.options.trigger.split(' ') | 1317 | var triggers = this.options.trigger.split(' ') |
1241 | 1318 | ||
@@ -1290,16 +1367,20 @@ if (typeof jQuery === 'undefined') { | |||
1290 | var self = obj instanceof this.constructor ? | 1367 | var self = obj instanceof this.constructor ? |
1291 | obj : $(obj.currentTarget).data('bs.' + this.type) | 1368 | obj : $(obj.currentTarget).data('bs.' + this.type) |
1292 | 1369 | ||
1293 | if (self && self.$tip && self.$tip.is(':visible')) { | ||
1294 | self.hoverState = 'in' | ||
1295 | return | ||
1296 | } | ||
1297 | |||
1298 | if (!self) { | 1370 | if (!self) { |
1299 | self = new this.constructor(obj.currentTarget, this.getDelegateOptions()) | 1371 | self = new this.constructor(obj.currentTarget, this.getDelegateOptions()) |
1300 | $(obj.currentTarget).data('bs.' + this.type, self) | 1372 | $(obj.currentTarget).data('bs.' + this.type, self) |
1301 | } | 1373 | } |
1302 | 1374 | ||
1375 | if (obj instanceof $.Event) { | ||
1376 | self.inState[obj.type == 'focusin' ? 'focus' : 'hover'] = true | ||
1377 | } | ||
1378 | |||
1379 | if (self.tip().hasClass('in') || self.hoverState == 'in') { | ||
1380 | self.hoverState = 'in' | ||
1381 | return | ||
1382 | } | ||
1383 | |||
1303 | clearTimeout(self.timeout) | 1384 | clearTimeout(self.timeout) |
1304 | 1385 | ||
1305 | self.hoverState = 'in' | 1386 | self.hoverState = 'in' |
@@ -1311,6 +1392,14 @@ if (typeof jQuery === 'undefined') { | |||
1311 | }, self.options.delay.show) | 1392 | }, self.options.delay.show) |
1312 | } | 1393 | } |
1313 | 1394 | ||
1395 | Tooltip.prototype.isInStateTrue = function () { | ||
1396 | for (var key in this.inState) { | ||
1397 | if (this.inState[key]) return true | ||
1398 | } | ||
1399 | |||
1400 | return false | ||
1401 | } | ||
1402 | |||
1314 | Tooltip.prototype.leave = function (obj) { | 1403 | Tooltip.prototype.leave = function (obj) { |
1315 | var self = obj instanceof this.constructor ? | 1404 | var self = obj instanceof this.constructor ? |
1316 | obj : $(obj.currentTarget).data('bs.' + this.type) | 1405 | obj : $(obj.currentTarget).data('bs.' + this.type) |
@@ -1320,6 +1409,12 @@ if (typeof jQuery === 'undefined') { | |||
1320 | $(obj.currentTarget).data('bs.' + this.type, self) | 1409 | $(obj.currentTarget).data('bs.' + this.type, self) |
1321 | } | 1410 | } |
1322 | 1411 | ||
1412 | if (obj instanceof $.Event) { | ||
1413 | self.inState[obj.type == 'focusout' ? 'focus' : 'hover'] = false | ||
1414 | } | ||
1415 | |||
1416 | if (self.isInStateTrue()) return | ||
1417 | |||
1323 | clearTimeout(self.timeout) | 1418 | clearTimeout(self.timeout) |
1324 | 1419 | ||
1325 | self.hoverState = 'out' | 1420 | self.hoverState = 'out' |
@@ -1366,6 +1461,7 @@ if (typeof jQuery === 'undefined') { | |||
1366 | .data('bs.' + this.type, this) | 1461 | .data('bs.' + this.type, this) |
1367 | 1462 | ||
1368 | this.options.container ? $tip.appendTo(this.options.container) : $tip.insertAfter(this.$element) | 1463 | this.options.container ? $tip.appendTo(this.options.container) : $tip.insertAfter(this.$element) |
1464 | this.$element.trigger('inserted.bs.' + this.type) | ||
1369 | 1465 | ||
1370 | var pos = this.getPosition() | 1466 | var pos = this.getPosition() |
1371 | var actualWidth = $tip[0].offsetWidth | 1467 | var actualWidth = $tip[0].offsetWidth |
@@ -1373,13 +1469,12 @@ if (typeof jQuery === 'undefined') { | |||
1373 | 1469 | ||
1374 | if (autoPlace) { | 1470 | if (autoPlace) { |
1375 | var orgPlacement = placement | 1471 | var orgPlacement = placement |
1376 | var $container = this.options.container ? $(this.options.container) : this.$element.parent() | 1472 | var viewportDim = this.getPosition(this.$viewport) |
1377 | var containerDim = this.getPosition($container) | ||
1378 | 1473 | ||
1379 | placement = placement == 'bottom' && pos.bottom + actualHeight > containerDim.bottom ? 'top' : | 1474 | placement = placement == 'bottom' && pos.bottom + actualHeight > viewportDim.bottom ? 'top' : |
1380 | placement == 'top' && pos.top - actualHeight < containerDim.top ? 'bottom' : | 1475 | placement == 'top' && pos.top - actualHeight < viewportDim.top ? 'bottom' : |
1381 | placement == 'right' && pos.right + actualWidth > containerDim.width ? 'left' : | 1476 | placement == 'right' && pos.right + actualWidth > viewportDim.width ? 'left' : |
1382 | placement == 'left' && pos.left - actualWidth < containerDim.left ? 'right' : | 1477 | placement == 'left' && pos.left - actualWidth < viewportDim.left ? 'right' : |
1383 | placement | 1478 | placement |
1384 | 1479 | ||
1385 | $tip | 1480 | $tip |
@@ -1420,8 +1515,8 @@ if (typeof jQuery === 'undefined') { | |||
1420 | if (isNaN(marginTop)) marginTop = 0 | 1515 | if (isNaN(marginTop)) marginTop = 0 |
1421 | if (isNaN(marginLeft)) marginLeft = 0 | 1516 | if (isNaN(marginLeft)) marginLeft = 0 |
1422 | 1517 | ||
1423 | offset.top = offset.top + marginTop | 1518 | offset.top += marginTop |
1424 | offset.left = offset.left + marginLeft | 1519 | offset.left += marginLeft |
1425 | 1520 | ||
1426 | // $.fn.offset doesn't round pixel values | 1521 | // $.fn.offset doesn't round pixel values |
1427 | // so we use setOffset directly with our own function B-0 | 1522 | // so we use setOffset directly with our own function B-0 |
@@ -1457,10 +1552,10 @@ if (typeof jQuery === 'undefined') { | |||
1457 | this.replaceArrow(arrowDelta, $tip[0][arrowOffsetPosition], isVertical) | 1552 | this.replaceArrow(arrowDelta, $tip[0][arrowOffsetPosition], isVertical) |
1458 | } | 1553 | } |
1459 | 1554 | ||
1460 | Tooltip.prototype.replaceArrow = function (delta, dimension, isHorizontal) { | 1555 | Tooltip.prototype.replaceArrow = function (delta, dimension, isVertical) { |
1461 | this.arrow() | 1556 | this.arrow() |
1462 | .css(isHorizontal ? 'left' : 'top', 50 * (1 - delta / dimension) + '%') | 1557 | .css(isVertical ? 'left' : 'top', 50 * (1 - delta / dimension) + '%') |
1463 | .css(isHorizontal ? 'top' : 'left', '') | 1558 | .css(isVertical ? 'top' : 'left', '') |
1464 | } | 1559 | } |
1465 | 1560 | ||
1466 | Tooltip.prototype.setContent = function () { | 1561 | Tooltip.prototype.setContent = function () { |
@@ -1473,14 +1568,16 @@ if (typeof jQuery === 'undefined') { | |||
1473 | 1568 | ||
1474 | Tooltip.prototype.hide = function (callback) { | 1569 | Tooltip.prototype.hide = function (callback) { |
1475 | var that = this | 1570 | var that = this |
1476 | var $tip = this.tip() | 1571 | var $tip = $(this.$tip) |
1477 | var e = $.Event('hide.bs.' + this.type) | 1572 | var e = $.Event('hide.bs.' + this.type) |
1478 | 1573 | ||
1479 | function complete() { | 1574 | function complete() { |
1480 | if (that.hoverState != 'in') $tip.detach() | 1575 | if (that.hoverState != 'in') $tip.detach() |
1481 | that.$element | 1576 | if (that.$element) { // TODO: Check whether guarding this code with this `if` is really necessary. |
1482 | .removeAttr('aria-describedby') | 1577 | that.$element |
1483 | .trigger('hidden.bs.' + that.type) | 1578 | .removeAttr('aria-describedby') |
1579 | .trigger('hidden.bs.' + that.type) | ||
1580 | } | ||
1484 | callback && callback() | 1581 | callback && callback() |
1485 | } | 1582 | } |
1486 | 1583 | ||
@@ -1490,7 +1587,7 @@ if (typeof jQuery === 'undefined') { | |||
1490 | 1587 | ||
1491 | $tip.removeClass('in') | 1588 | $tip.removeClass('in') |
1492 | 1589 | ||
1493 | $.support.transition && this.$tip.hasClass('fade') ? | 1590 | $.support.transition && $tip.hasClass('fade') ? |
1494 | $tip | 1591 | $tip |
1495 | .one('bsTransitionEnd', complete) | 1592 | .one('bsTransitionEnd', complete) |
1496 | .emulateTransitionEnd(Tooltip.TRANSITION_DURATION) : | 1593 | .emulateTransitionEnd(Tooltip.TRANSITION_DURATION) : |
@@ -1503,7 +1600,7 @@ if (typeof jQuery === 'undefined') { | |||
1503 | 1600 | ||
1504 | Tooltip.prototype.fixTitle = function () { | 1601 | Tooltip.prototype.fixTitle = function () { |
1505 | var $e = this.$element | 1602 | var $e = this.$element |
1506 | if ($e.attr('title') || typeof ($e.attr('data-original-title')) != 'string') { | 1603 | if ($e.attr('title') || typeof $e.attr('data-original-title') != 'string') { |
1507 | $e.attr('data-original-title', $e.attr('title') || '').attr('title', '') | 1604 | $e.attr('data-original-title', $e.attr('title') || '').attr('title', '') |
1508 | } | 1605 | } |
1509 | } | 1606 | } |
@@ -1523,7 +1620,10 @@ if (typeof jQuery === 'undefined') { | |||
1523 | // width and height are missing in IE8, so compute them manually; see https://github.com/twbs/bootstrap/issues/14093 | 1620 | // width and height are missing in IE8, so compute them manually; see https://github.com/twbs/bootstrap/issues/14093 |
1524 | elRect = $.extend({}, elRect, { width: elRect.right - elRect.left, height: elRect.bottom - elRect.top }) | 1621 | elRect = $.extend({}, elRect, { width: elRect.right - elRect.left, height: elRect.bottom - elRect.top }) |
1525 | } | 1622 | } |
1526 | var elOffset = isBody ? { top: 0, left: 0 } : $element.offset() | 1623 | var isSvg = window.SVGElement && el instanceof window.SVGElement |
1624 | // Avoid using $.offset() on SVGs since it gives incorrect results in jQuery 3. | ||
1625 | // See https://github.com/twbs/bootstrap/issues/20280 | ||
1626 | var elOffset = isBody ? { top: 0, left: 0 } : (isSvg ? null : $element.offset()) | ||
1527 | var scroll = { scroll: isBody ? document.documentElement.scrollTop || document.body.scrollTop : $element.scrollTop() } | 1627 | var scroll = { scroll: isBody ? document.documentElement.scrollTop || document.body.scrollTop : $element.scrollTop() } |
1528 | var outerDims = isBody ? { width: $(window).width(), height: $(window).height() } : null | 1628 | var outerDims = isBody ? { width: $(window).width(), height: $(window).height() } : null |
1529 | 1629 | ||
@@ -1531,10 +1631,10 @@ if (typeof jQuery === 'undefined') { | |||
1531 | } | 1631 | } |
1532 | 1632 | ||
1533 | Tooltip.prototype.getCalculatedOffset = function (placement, pos, actualWidth, actualHeight) { | 1633 | Tooltip.prototype.getCalculatedOffset = function (placement, pos, actualWidth, actualHeight) { |
1534 | return placement == 'bottom' ? { top: pos.top + pos.height, left: pos.left + pos.width / 2 - actualWidth / 2 } : | 1634 | return placement == 'bottom' ? { top: pos.top + pos.height, left: pos.left + pos.width / 2 - actualWidth / 2 } : |
1535 | placement == 'top' ? { top: pos.top - actualHeight, left: pos.left + pos.width / 2 - actualWidth / 2 } : | 1635 | placement == 'top' ? { top: pos.top - actualHeight, left: pos.left + pos.width / 2 - actualWidth / 2 } : |
1536 | placement == 'left' ? { top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left - actualWidth } : | 1636 | placement == 'left' ? { top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left - actualWidth } : |
1537 | /* placement == 'right' */ { top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left + pos.width } | 1637 | /* placement == 'right' */ { top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left + pos.width } |
1538 | 1638 | ||
1539 | } | 1639 | } |
1540 | 1640 | ||
@@ -1558,7 +1658,7 @@ if (typeof jQuery === 'undefined') { | |||
1558 | var rightEdgeOffset = pos.left + viewportPadding + actualWidth | 1658 | var rightEdgeOffset = pos.left + viewportPadding + actualWidth |
1559 | if (leftEdgeOffset < viewportDimensions.left) { // left overflow | 1659 | if (leftEdgeOffset < viewportDimensions.left) { // left overflow |
1560 | delta.left = viewportDimensions.left - leftEdgeOffset | 1660 | delta.left = viewportDimensions.left - leftEdgeOffset |
1561 | } else if (rightEdgeOffset > viewportDimensions.width) { // right overflow | 1661 | } else if (rightEdgeOffset > viewportDimensions.right) { // right overflow |
1562 | delta.left = viewportDimensions.left + viewportDimensions.width - rightEdgeOffset | 1662 | delta.left = viewportDimensions.left + viewportDimensions.width - rightEdgeOffset |
1563 | } | 1663 | } |
1564 | } | 1664 | } |
@@ -1584,7 +1684,13 @@ if (typeof jQuery === 'undefined') { | |||
1584 | } | 1684 | } |
1585 | 1685 | ||
1586 | Tooltip.prototype.tip = function () { | 1686 | Tooltip.prototype.tip = function () { |
1587 | return (this.$tip = this.$tip || $(this.options.template)) | 1687 | if (!this.$tip) { |
1688 | this.$tip = $(this.options.template) | ||
1689 | if (this.$tip.length != 1) { | ||
1690 | throw new Error(this.type + ' `template` option must consist of exactly 1 top-level element!') | ||
1691 | } | ||
1692 | } | ||
1693 | return this.$tip | ||
1588 | } | 1694 | } |
1589 | 1695 | ||
1590 | Tooltip.prototype.arrow = function () { | 1696 | Tooltip.prototype.arrow = function () { |
@@ -1613,7 +1719,13 @@ if (typeof jQuery === 'undefined') { | |||
1613 | } | 1719 | } |
1614 | } | 1720 | } |
1615 | 1721 | ||
1616 | self.tip().hasClass('in') ? self.leave(self) : self.enter(self) | 1722 | if (e) { |
1723 | self.inState.click = !self.inState.click | ||
1724 | if (self.isInStateTrue()) self.enter(self) | ||
1725 | else self.leave(self) | ||
1726 | } else { | ||
1727 | self.tip().hasClass('in') ? self.leave(self) : self.enter(self) | ||
1728 | } | ||
1617 | } | 1729 | } |
1618 | 1730 | ||
1619 | Tooltip.prototype.destroy = function () { | 1731 | Tooltip.prototype.destroy = function () { |
@@ -1621,6 +1733,13 @@ if (typeof jQuery === 'undefined') { | |||
1621 | clearTimeout(this.timeout) | 1733 | clearTimeout(this.timeout) |
1622 | this.hide(function () { | 1734 | this.hide(function () { |
1623 | that.$element.off('.' + that.type).removeData('bs.' + that.type) | 1735 | that.$element.off('.' + that.type).removeData('bs.' + that.type) |
1736 | if (that.$tip) { | ||
1737 | that.$tip.detach() | ||
1738 | } | ||
1739 | that.$tip = null | ||
1740 | that.$arrow = null | ||
1741 | that.$viewport = null | ||
1742 | that.$element = null | ||
1624 | }) | 1743 | }) |
1625 | } | 1744 | } |
1626 | 1745 | ||
@@ -1630,18 +1749,12 @@ if (typeof jQuery === 'undefined') { | |||
1630 | 1749 | ||
1631 | function Plugin(option) { | 1750 | function Plugin(option) { |
1632 | return this.each(function () { | 1751 | return this.each(function () { |
1633 | var $this = $(this) | 1752 | var $this = $(this) |
1634 | var data = $this.data('bs.tooltip') | 1753 | var data = $this.data('bs.tooltip') |
1635 | var options = typeof option == 'object' && option | 1754 | var options = typeof option == 'object' && option |
1636 | var selector = options && options.selector | 1755 | |
1637 | 1756 | if (!data && /destroy|hide/.test(option)) return | |
1638 | if (!data && option == 'destroy') return | 1757 | if (!data) $this.data('bs.tooltip', (data = new Tooltip(this, options))) |
1639 | if (selector) { | ||
1640 | if (!data) $this.data('bs.tooltip', (data = {})) | ||
1641 | if (!data[selector]) data[selector] = new Tooltip(this, options) | ||
1642 | } else { | ||
1643 | if (!data) $this.data('bs.tooltip', (data = new Tooltip(this, options))) | ||
1644 | } | ||
1645 | if (typeof option == 'string') data[option]() | 1758 | if (typeof option == 'string') data[option]() |
1646 | }) | 1759 | }) |
1647 | } | 1760 | } |
@@ -1663,10 +1776,10 @@ if (typeof jQuery === 'undefined') { | |||
1663 | }(jQuery); | 1776 | }(jQuery); |
1664 | 1777 | ||
1665 | /* ======================================================================== | 1778 | /* ======================================================================== |
1666 | * Bootstrap: popover.js v3.3.0 | 1779 | * Bootstrap: popover.js v3.3.7 |
1667 | * http://getbootstrap.com/javascript/#popovers | 1780 | * http://getbootstrap.com/javascript/#popovers |
1668 | * ======================================================================== | 1781 | * ======================================================================== |
1669 | * Copyright 2011-2014 Twitter, Inc. | 1782 | * Copyright 2011-2016 Twitter, Inc. |
1670 | * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) | 1783 | * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) |
1671 | * ======================================================================== */ | 1784 | * ======================================================================== */ |
1672 | 1785 | ||
@@ -1683,7 +1796,7 @@ if (typeof jQuery === 'undefined') { | |||
1683 | 1796 | ||
1684 | if (!$.fn.tooltip) throw new Error('Popover requires tooltip.js') | 1797 | if (!$.fn.tooltip) throw new Error('Popover requires tooltip.js') |
1685 | 1798 | ||
1686 | Popover.VERSION = '3.3.0' | 1799 | Popover.VERSION = '3.3.7' |
1687 | 1800 | ||
1688 | Popover.DEFAULTS = $.extend({}, $.fn.tooltip.Constructor.DEFAULTS, { | 1801 | Popover.DEFAULTS = $.extend({}, $.fn.tooltip.Constructor.DEFAULTS, { |
1689 | placement: 'right', | 1802 | placement: 'right', |
@@ -1739,29 +1852,18 @@ if (typeof jQuery === 'undefined') { | |||
1739 | return (this.$arrow = this.$arrow || this.tip().find('.arrow')) | 1852 | return (this.$arrow = this.$arrow || this.tip().find('.arrow')) |
1740 | } | 1853 | } |
1741 | 1854 | ||
1742 | Popover.prototype.tip = function () { | ||
1743 | if (!this.$tip) this.$tip = $(this.options.template) | ||
1744 | return this.$tip | ||
1745 | } | ||
1746 | |||
1747 | 1855 | ||
1748 | // POPOVER PLUGIN DEFINITION | 1856 | // POPOVER PLUGIN DEFINITION |
1749 | // ========================= | 1857 | // ========================= |
1750 | 1858 | ||
1751 | function Plugin(option) { | 1859 | function Plugin(option) { |
1752 | return this.each(function () { | 1860 | return this.each(function () { |
1753 | var $this = $(this) | 1861 | var $this = $(this) |
1754 | var data = $this.data('bs.popover') | 1862 | var data = $this.data('bs.popover') |
1755 | var options = typeof option == 'object' && option | 1863 | var options = typeof option == 'object' && option |
1756 | var selector = options && options.selector | 1864 | |
1757 | 1865 | if (!data && /destroy|hide/.test(option)) return | |
1758 | if (!data && option == 'destroy') return | 1866 | if (!data) $this.data('bs.popover', (data = new Popover(this, options))) |
1759 | if (selector) { | ||
1760 | if (!data) $this.data('bs.popover', (data = {})) | ||
1761 | if (!data[selector]) data[selector] = new Popover(this, options) | ||
1762 | } else { | ||
1763 | if (!data) $this.data('bs.popover', (data = new Popover(this, options))) | ||
1764 | } | ||
1765 | if (typeof option == 'string') data[option]() | 1867 | if (typeof option == 'string') data[option]() |
1766 | }) | 1868 | }) |
1767 | } | 1869 | } |
@@ -1783,10 +1885,10 @@ if (typeof jQuery === 'undefined') { | |||
1783 | }(jQuery); | 1885 | }(jQuery); |
1784 | 1886 | ||
1785 | /* ======================================================================== | 1887 | /* ======================================================================== |
1786 | * Bootstrap: scrollspy.js v3.3.0 | 1888 | * Bootstrap: scrollspy.js v3.3.7 |
1787 | * http://getbootstrap.com/javascript/#scrollspy | 1889 | * http://getbootstrap.com/javascript/#scrollspy |
1788 | * ======================================================================== | 1890 | * ======================================================================== |
1789 | * Copyright 2011-2014 Twitter, Inc. | 1891 | * Copyright 2011-2016 Twitter, Inc. |
1790 | * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) | 1892 | * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) |
1791 | * ======================================================================== */ | 1893 | * ======================================================================== */ |
1792 | 1894 | ||
@@ -1798,10 +1900,8 @@ if (typeof jQuery === 'undefined') { | |||
1798 | // ========================== | 1900 | // ========================== |
1799 | 1901 | ||
1800 | function ScrollSpy(element, options) { | 1902 | function ScrollSpy(element, options) { |
1801 | var process = $.proxy(this.process, this) | 1903 | this.$body = $(document.body) |
1802 | 1904 | this.$scrollElement = $(element).is(document.body) ? $(window) : $(element) | |
1803 | this.$body = $('body') | ||
1804 | this.$scrollElement = $(element).is('body') ? $(window) : $(element) | ||
1805 | this.options = $.extend({}, ScrollSpy.DEFAULTS, options) | 1905 | this.options = $.extend({}, ScrollSpy.DEFAULTS, options) |
1806 | this.selector = (this.options.target || '') + ' .nav li > a' | 1906 | this.selector = (this.options.target || '') + ' .nav li > a' |
1807 | this.offsets = [] | 1907 | this.offsets = [] |
@@ -1809,12 +1909,12 @@ if (typeof jQuery === 'undefined') { | |||
1809 | this.activeTarget = null | 1909 | this.activeTarget = null |
1810 | this.scrollHeight = 0 | 1910 | this.scrollHeight = 0 |
1811 | 1911 | ||
1812 | this.$scrollElement.on('scroll.bs.scrollspy', process) | 1912 | this.$scrollElement.on('scroll.bs.scrollspy', $.proxy(this.process, this)) |
1813 | this.refresh() | 1913 | this.refresh() |
1814 | this.process() | 1914 | this.process() |
1815 | } | 1915 | } |
1816 | 1916 | ||
1817 | ScrollSpy.VERSION = '3.3.0' | 1917 | ScrollSpy.VERSION = '3.3.7' |
1818 | 1918 | ||
1819 | ScrollSpy.DEFAULTS = { | 1919 | ScrollSpy.DEFAULTS = { |
1820 | offset: 10 | 1920 | offset: 10 |
@@ -1825,20 +1925,19 @@ if (typeof jQuery === 'undefined') { | |||
1825 | } | 1925 | } |
1826 | 1926 | ||
1827 | ScrollSpy.prototype.refresh = function () { | 1927 | ScrollSpy.prototype.refresh = function () { |
1828 | var offsetMethod = 'offset' | 1928 | var that = this |
1829 | var offsetBase = 0 | 1929 | var offsetMethod = 'offset' |
1930 | var offsetBase = 0 | ||
1931 | |||
1932 | this.offsets = [] | ||
1933 | this.targets = [] | ||
1934 | this.scrollHeight = this.getScrollHeight() | ||
1830 | 1935 | ||
1831 | if (!$.isWindow(this.$scrollElement[0])) { | 1936 | if (!$.isWindow(this.$scrollElement[0])) { |
1832 | offsetMethod = 'position' | 1937 | offsetMethod = 'position' |
1833 | offsetBase = this.$scrollElement.scrollTop() | 1938 | offsetBase = this.$scrollElement.scrollTop() |
1834 | } | 1939 | } |
1835 | 1940 | ||
1836 | this.offsets = [] | ||
1837 | this.targets = [] | ||
1838 | this.scrollHeight = this.getScrollHeight() | ||
1839 | |||
1840 | var self = this | ||
1841 | |||
1842 | this.$body | 1941 | this.$body |
1843 | .find(this.selector) | 1942 | .find(this.selector) |
1844 | .map(function () { | 1943 | .map(function () { |
@@ -1853,8 +1952,8 @@ if (typeof jQuery === 'undefined') { | |||
1853 | }) | 1952 | }) |
1854 | .sort(function (a, b) { return a[0] - b[0] }) | 1953 | .sort(function (a, b) { return a[0] - b[0] }) |
1855 | .each(function () { | 1954 | .each(function () { |
1856 | self.offsets.push(this[0]) | 1955 | that.offsets.push(this[0]) |
1857 | self.targets.push(this[1]) | 1956 | that.targets.push(this[1]) |
1858 | }) | 1957 | }) |
1859 | } | 1958 | } |
1860 | 1959 | ||
@@ -1883,7 +1982,7 @@ if (typeof jQuery === 'undefined') { | |||
1883 | for (i = offsets.length; i--;) { | 1982 | for (i = offsets.length; i--;) { |
1884 | activeTarget != targets[i] | 1983 | activeTarget != targets[i] |
1885 | && scrollTop >= offsets[i] | 1984 | && scrollTop >= offsets[i] |
1886 | && (!offsets[i + 1] || scrollTop <= offsets[i + 1]) | 1985 | && (offsets[i + 1] === undefined || scrollTop < offsets[i + 1]) |
1887 | && this.activate(targets[i]) | 1986 | && this.activate(targets[i]) |
1888 | } | 1987 | } |
1889 | } | 1988 | } |
@@ -1894,8 +1993,8 @@ if (typeof jQuery === 'undefined') { | |||
1894 | this.clear() | 1993 | this.clear() |
1895 | 1994 | ||
1896 | var selector = this.selector + | 1995 | var selector = this.selector + |
1897 | '[data-target="' + target + '"],' + | 1996 | '[data-target="' + target + '"],' + |
1898 | this.selector + '[href="' + target + '"]' | 1997 | this.selector + '[href="' + target + '"]' |
1899 | 1998 | ||
1900 | var active = $(selector) | 1999 | var active = $(selector) |
1901 | .parents('li') | 2000 | .parents('li') |
@@ -1959,10 +2058,10 @@ if (typeof jQuery === 'undefined') { | |||
1959 | }(jQuery); | 2058 | }(jQuery); |
1960 | 2059 | ||
1961 | /* ======================================================================== | 2060 | /* ======================================================================== |
1962 | * Bootstrap: tab.js v3.3.0 | 2061 | * Bootstrap: tab.js v3.3.7 |
1963 | * http://getbootstrap.com/javascript/#tabs | 2062 | * http://getbootstrap.com/javascript/#tabs |
1964 | * ======================================================================== | 2063 | * ======================================================================== |
1965 | * Copyright 2011-2014 Twitter, Inc. | 2064 | * Copyright 2011-2016 Twitter, Inc. |
1966 | * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) | 2065 | * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) |
1967 | * ======================================================================== */ | 2066 | * ======================================================================== */ |
1968 | 2067 | ||
@@ -1974,10 +2073,12 @@ if (typeof jQuery === 'undefined') { | |||
1974 | // ==================== | 2073 | // ==================== |
1975 | 2074 | ||
1976 | var Tab = function (element) { | 2075 | var Tab = function (element) { |
2076 | // jscs:disable requireDollarBeforejQueryAssignment | ||
1977 | this.element = $(element) | 2077 | this.element = $(element) |
2078 | // jscs:enable requireDollarBeforejQueryAssignment | ||
1978 | } | 2079 | } |
1979 | 2080 | ||
1980 | Tab.VERSION = '3.3.0' | 2081 | Tab.VERSION = '3.3.7' |
1981 | 2082 | ||
1982 | Tab.TRANSITION_DURATION = 150 | 2083 | Tab.TRANSITION_DURATION = 150 |
1983 | 2084 | ||
@@ -2025,7 +2126,7 @@ if (typeof jQuery === 'undefined') { | |||
2025 | var $active = container.find('> .active') | 2126 | var $active = container.find('> .active') |
2026 | var transition = callback | 2127 | var transition = callback |
2027 | && $.support.transition | 2128 | && $.support.transition |
2028 | && (($active.length && $active.hasClass('fade')) || !!container.find('> .fade').length) | 2129 | && ($active.length && $active.hasClass('fade') || !!container.find('> .fade').length) |
2029 | 2130 | ||
2030 | function next() { | 2131 | function next() { |
2031 | $active | 2132 | $active |
@@ -2048,7 +2149,7 @@ if (typeof jQuery === 'undefined') { | |||
2048 | element.removeClass('fade') | 2149 | element.removeClass('fade') |
2049 | } | 2150 | } |
2050 | 2151 | ||
2051 | if (element.parent('.dropdown-menu')) { | 2152 | if (element.parent('.dropdown-menu').length) { |
2052 | element | 2153 | element |
2053 | .closest('li.dropdown') | 2154 | .closest('li.dropdown') |
2054 | .addClass('active') | 2155 | .addClass('active') |
@@ -2113,10 +2214,10 @@ if (typeof jQuery === 'undefined') { | |||
2113 | }(jQuery); | 2214 | }(jQuery); |
2114 | 2215 | ||
2115 | /* ======================================================================== | 2216 | /* ======================================================================== |
2116 | * Bootstrap: affix.js v3.3.0 | 2217 | * Bootstrap: affix.js v3.3.7 |
2117 | * http://getbootstrap.com/javascript/#affix | 2218 | * http://getbootstrap.com/javascript/#affix |
2118 | * ======================================================================== | 2219 | * ======================================================================== |
2119 | * Copyright 2011-2014 Twitter, Inc. | 2220 | * Copyright 2011-2016 Twitter, Inc. |
2120 | * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) | 2221 | * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) |
2121 | * ======================================================================== */ | 2222 | * ======================================================================== */ |
2122 | 2223 | ||
@@ -2135,14 +2236,14 @@ if (typeof jQuery === 'undefined') { | |||
2135 | .on('click.bs.affix.data-api', $.proxy(this.checkPositionWithEventLoop, this)) | 2236 | .on('click.bs.affix.data-api', $.proxy(this.checkPositionWithEventLoop, this)) |
2136 | 2237 | ||
2137 | this.$element = $(element) | 2238 | this.$element = $(element) |
2138 | this.affixed = | 2239 | this.affixed = null |
2139 | this.unpin = | 2240 | this.unpin = null |
2140 | this.pinnedOffset = null | 2241 | this.pinnedOffset = null |
2141 | 2242 | ||
2142 | this.checkPosition() | 2243 | this.checkPosition() |
2143 | } | 2244 | } |
2144 | 2245 | ||
2145 | Affix.VERSION = '3.3.0' | 2246 | Affix.VERSION = '3.3.7' |
2146 | 2247 | ||
2147 | Affix.RESET = 'affix affix-top affix-bottom' | 2248 | Affix.RESET = 'affix affix-top affix-bottom' |
2148 | 2249 | ||
@@ -2167,7 +2268,7 @@ if (typeof jQuery === 'undefined') { | |||
2167 | var colliderTop = initializing ? scrollTop : position.top | 2268 | var colliderTop = initializing ? scrollTop : position.top |
2168 | var colliderHeight = initializing ? targetHeight : height | 2269 | var colliderHeight = initializing ? targetHeight : height |
2169 | 2270 | ||
2170 | if (offsetTop != null && colliderTop <= offsetTop) return 'top' | 2271 | if (offsetTop != null && scrollTop <= offsetTop) return 'top' |
2171 | if (offsetBottom != null && (colliderTop + colliderHeight >= scrollHeight - offsetBottom)) return 'bottom' | 2272 | if (offsetBottom != null && (colliderTop + colliderHeight >= scrollHeight - offsetBottom)) return 'bottom' |
2172 | 2273 | ||
2173 | return false | 2274 | return false |
@@ -2192,7 +2293,7 @@ if (typeof jQuery === 'undefined') { | |||
2192 | var offset = this.options.offset | 2293 | var offset = this.options.offset |
2193 | var offsetTop = offset.top | 2294 | var offsetTop = offset.top |
2194 | var offsetBottom = offset.bottom | 2295 | var offsetBottom = offset.bottom |
2195 | var scrollHeight = $('body').height() | 2296 | var scrollHeight = Math.max($(document).height(), $(document.body).height()) |
2196 | 2297 | ||
2197 | if (typeof offset != 'object') offsetBottom = offsetTop = offset | 2298 | if (typeof offset != 'object') offsetBottom = offsetTop = offset |
2198 | if (typeof offsetTop == 'function') offsetTop = offset.top(this.$element) | 2299 | if (typeof offsetTop == 'function') offsetTop = offset.top(this.$element) |