bootstrap-sass 3.3.0.1 → 3.4.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (139) hide show
  1. checksums.yaml +5 -5
  2. data/.gitignore +1 -0
  3. data/.travis.yml +8 -14
  4. data/CHANGELOG.md +64 -0
  5. data/CONTRIBUTING.md +8 -1
  6. data/Gemfile +1 -4
  7. data/LICENSE +2 -1
  8. data/README.md +135 -114
  9. data/Rakefile +58 -12
  10. data/assets/fonts/bootstrap/glyphicons-halflings-regular.eot +0 -0
  11. data/assets/fonts/bootstrap/glyphicons-halflings-regular.svg +273 -214
  12. data/assets/fonts/bootstrap/glyphicons-halflings-regular.ttf +0 -0
  13. data/assets/fonts/bootstrap/glyphicons-halflings-regular.woff +0 -0
  14. data/assets/fonts/bootstrap/glyphicons-halflings-regular.woff2 +0 -0
  15. data/assets/javascripts/bootstrap/affix.js +11 -9
  16. data/assets/javascripts/bootstrap/alert.js +6 -5
  17. data/assets/javascripts/bootstrap/button.js +25 -16
  18. data/assets/javascripts/bootstrap/carousel.js +25 -18
  19. data/assets/javascripts/bootstrap/collapse.js +13 -12
  20. data/assets/javascripts/bootstrap/dropdown.js +51 -47
  21. data/assets/javascripts/bootstrap/modal.js +112 -35
  22. data/assets/javascripts/bootstrap/popover.js +31 -27
  23. data/assets/javascripts/bootstrap/scrollspy.js +19 -22
  24. data/assets/javascripts/bootstrap/tab.js +14 -12
  25. data/assets/javascripts/bootstrap/tooltip.js +255 -56
  26. data/assets/javascripts/bootstrap/transition.js +5 -5
  27. data/assets/javascripts/bootstrap-sprockets.js +2 -2
  28. data/assets/javascripts/bootstrap.js +1282 -962
  29. data/assets/javascripts/bootstrap.min.js +6 -0
  30. data/assets/stylesheets/_bootstrap-compass.scss +2 -0
  31. data/assets/stylesheets/_bootstrap-mincer.scss +4 -2
  32. data/assets/stylesheets/_bootstrap-sprockets.scss +2 -0
  33. data/assets/stylesheets/_bootstrap.scss +6 -0
  34. data/assets/stylesheets/bootstrap/_alerts.scss +8 -3
  35. data/assets/stylesheets/bootstrap/_badges.scss +16 -5
  36. data/assets/stylesheets/bootstrap/_breadcrumbs.scss +3 -1
  37. data/assets/stylesheets/bootstrap/_button-groups.scss +11 -14
  38. data/assets/stylesheets/bootstrap/_buttons.scss +18 -10
  39. data/assets/stylesheets/bootstrap/_carousel.scss +40 -36
  40. data/assets/stylesheets/bootstrap/_close.scss +2 -0
  41. data/assets/stylesheets/bootstrap/_code.scss +3 -3
  42. data/assets/stylesheets/bootstrap/_component-animations.scss +2 -2
  43. data/assets/stylesheets/bootstrap/_dropdowns.scss +24 -24
  44. data/assets/stylesheets/bootstrap/_forms.scss +149 -103
  45. data/assets/stylesheets/bootstrap/_glyphicons.scss +85 -12
  46. data/assets/stylesheets/bootstrap/_grid.scss +10 -0
  47. data/assets/stylesheets/bootstrap/_input-groups.scss +10 -5
  48. data/assets/stylesheets/bootstrap/_jumbotron.scss +11 -5
  49. data/assets/stylesheets/bootstrap/_labels.scss +1 -1
  50. data/assets/stylesheets/bootstrap/_list-group.scss +30 -34
  51. data/assets/stylesheets/bootstrap/_media.scss +19 -0
  52. data/assets/stylesheets/bootstrap/_mixins.scss +1 -0
  53. data/assets/stylesheets/bootstrap/_modals.scss +9 -8
  54. data/assets/stylesheets/bootstrap/_navbar.scss +77 -82
  55. data/assets/stylesheets/bootstrap/_navs.scss +4 -6
  56. data/assets/stylesheets/bootstrap/_normalize.scss +13 -13
  57. data/assets/stylesheets/bootstrap/_pager.scss +2 -2
  58. data/assets/stylesheets/bootstrap/_pagination.scss +15 -17
  59. data/assets/stylesheets/bootstrap/_panels.scss +16 -6
  60. data/assets/stylesheets/bootstrap/_popovers.scss +50 -58
  61. data/assets/stylesheets/bootstrap/_print.scss +90 -98
  62. data/assets/stylesheets/bootstrap/_progress-bars.scss +3 -3
  63. data/assets/stylesheets/bootstrap/_responsive-embed.scss +10 -10
  64. data/assets/stylesheets/bootstrap/_responsive-utilities.scss +11 -6
  65. data/assets/stylesheets/bootstrap/_scaffolding.scss +18 -7
  66. data/assets/stylesheets/bootstrap/_tables.scss +24 -24
  67. data/assets/stylesheets/bootstrap/_theme.scss +57 -22
  68. data/assets/stylesheets/bootstrap/_thumbnails.scss +1 -1
  69. data/assets/stylesheets/bootstrap/_tooltip.scss +49 -32
  70. data/assets/stylesheets/bootstrap/_type.scss +12 -12
  71. data/assets/stylesheets/bootstrap/_utilities.scss +0 -1
  72. data/assets/stylesheets/bootstrap/_variables.scss +27 -17
  73. data/assets/stylesheets/bootstrap/_wells.scss +2 -2
  74. data/assets/stylesheets/bootstrap/mixins/_alerts.scss +2 -1
  75. data/assets/stylesheets/bootstrap/mixins/_background-variant.scss +2 -1
  76. data/assets/stylesheets/bootstrap/mixins/_border-radius.scss +4 -4
  77. data/assets/stylesheets/bootstrap/mixins/_buttons.scss +20 -11
  78. data/assets/stylesheets/bootstrap/mixins/_center-block.scss +1 -1
  79. data/assets/stylesheets/bootstrap/mixins/_clearfix.scss +1 -1
  80. data/assets/stylesheets/bootstrap/mixins/_forms.scss +4 -4
  81. data/assets/stylesheets/bootstrap/mixins/_gradients.scss +6 -8
  82. data/assets/stylesheets/bootstrap/mixins/_grid-framework.scss +2 -2
  83. data/assets/stylesheets/bootstrap/mixins/_grid.scss +8 -8
  84. data/assets/stylesheets/bootstrap/mixins/_hide-text.scss +3 -3
  85. data/assets/stylesheets/bootstrap/mixins/_image.scss +5 -10
  86. data/assets/stylesheets/bootstrap/mixins/_list-group.scss +3 -2
  87. data/assets/stylesheets/bootstrap/mixins/_opacity.scss +2 -3
  88. data/assets/stylesheets/bootstrap/mixins/_pagination.scss +2 -1
  89. data/assets/stylesheets/bootstrap/mixins/_reset-text.scss +18 -0
  90. data/assets/stylesheets/bootstrap/mixins/_resize.scss +1 -1
  91. data/assets/stylesheets/bootstrap/mixins/_responsive-visibility.scss +1 -5
  92. data/assets/stylesheets/bootstrap/mixins/_tab-focus.scss +3 -3
  93. data/assets/stylesheets/bootstrap/mixins/_text-emphasis.scss +2 -1
  94. data/assets/stylesheets/bootstrap/mixins/_vendor-prefixes.scss +4 -4
  95. data/bootstrap-sass.gemspec +10 -9
  96. data/bower.json +6 -20
  97. data/composer.json +2 -2
  98. data/eyeglass-exports.js +7 -0
  99. data/lib/bootstrap-sass/engine.rb +6 -1
  100. data/lib/bootstrap-sass/version.rb +2 -2
  101. data/lib/bootstrap-sass.rb +32 -13
  102. data/package-lock.json +1611 -0
  103. data/package.json +21 -7
  104. data/sache.json +1 -1
  105. data/tasks/bower.rake +2 -5
  106. data/tasks/converter/fonts_conversion.rb +1 -1
  107. data/tasks/converter/js_conversion.rb +7 -5
  108. data/tasks/converter/less_conversion.rb +48 -37
  109. data/tasks/converter/network.rb +12 -7
  110. data/tasks/converter.rb +1 -1
  111. data/templates/project/_bootstrap-variables.sass +27 -18
  112. data/templates/project/styles.sass +3 -0
  113. data/test/compilation_test.rb +24 -12
  114. data/test/dummy_rails/app/assets/stylesheets/{application.css.sass → application.sass} +0 -0
  115. data/test/dummy_rails/app/views/pages/root.html.slim +43 -0
  116. data/test/dummy_rails/config/application.rb +2 -1
  117. data/test/dummy_rails/config/boot.rb +1 -1
  118. data/test/dummy_rails/config/environments/development.rb +0 -3
  119. data/test/dummy_rails/config/environments/production.rb +7 -1
  120. data/test/dummy_rails/config/environments/test.rb +9 -1
  121. data/test/dummy_sass_only/Gemfile +1 -1
  122. data/test/dummy_sass_only/compile.rb +14 -7
  123. data/test/dummy_sass_only/import_all.scss +2 -0
  124. data/test/gemfiles/default.gemfile +3 -0
  125. data/test/node_mincer_test.rb +2 -3
  126. data/test/node_sass_compile_test.sh +4 -3
  127. data/test/sass_test.rb +10 -7
  128. data/test/sprockets_rails_test.rb +12 -8
  129. data/test/support/dummy_rails_integration.rb +1 -1
  130. data/test/support/reporting.rb +10 -0
  131. data/test/test_helper.rb +3 -2
  132. metadata +56 -46
  133. data/test/compass_test.rb +0 -9
  134. data/test/dummy_rails/log/development.log +0 -0
  135. data/test/dummy_sass_only/import_all.sass +0 -2
  136. data/test/gemfiles/sass_3_2.gemfile +0 -6
  137. data/test/gemfiles/sass_3_3.gemfile +0 -6
  138. data/test/gemfiles/sass_3_4.gemfile +0 -7
  139. data/test/gemfiles/sass_head.gemfile +0 -6
@@ -1,8 +1,8 @@
1
1
  /* ========================================================================
2
- * Bootstrap: affix.js v3.3.0
3
- * http://getbootstrap.com/javascript/#affix
2
+ * Bootstrap: affix.js v3.4.1
3
+ * https://getbootstrap.com/docs/3.4/javascript/#affix
4
4
  * ========================================================================
5
- * Copyright 2011-2014 Twitter, Inc.
5
+ * Copyright 2011-2019 Twitter, Inc.
6
6
  * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
7
7
  * ======================================================================== */
8
8
 
@@ -16,19 +16,21 @@
16
16
  var Affix = function (element, options) {
17
17
  this.options = $.extend({}, Affix.DEFAULTS, options)
18
18
 
19
- this.$target = $(this.options.target)
19
+ var target = this.options.target === Affix.DEFAULTS.target ? $(this.options.target) : $(document).find(this.options.target)
20
+
21
+ this.$target = target
20
22
  .on('scroll.bs.affix.data-api', $.proxy(this.checkPosition, this))
21
23
  .on('click.bs.affix.data-api', $.proxy(this.checkPositionWithEventLoop, this))
22
24
 
23
25
  this.$element = $(element)
24
- this.affixed =
25
- this.unpin =
26
+ this.affixed = null
27
+ this.unpin = null
26
28
  this.pinnedOffset = null
27
29
 
28
30
  this.checkPosition()
29
31
  }
30
32
 
31
- Affix.VERSION = '3.3.0'
33
+ Affix.VERSION = '3.4.1'
32
34
 
33
35
  Affix.RESET = 'affix affix-top affix-bottom'
34
36
 
@@ -53,7 +55,7 @@
53
55
  var colliderTop = initializing ? scrollTop : position.top
54
56
  var colliderHeight = initializing ? targetHeight : height
55
57
 
56
- if (offsetTop != null && colliderTop <= offsetTop) return 'top'
58
+ if (offsetTop != null && scrollTop <= offsetTop) return 'top'
57
59
  if (offsetBottom != null && (colliderTop + colliderHeight >= scrollHeight - offsetBottom)) return 'bottom'
58
60
 
59
61
  return false
@@ -78,7 +80,7 @@
78
80
  var offset = this.options.offset
79
81
  var offsetTop = offset.top
80
82
  var offsetBottom = offset.bottom
81
- var scrollHeight = $('body').height()
83
+ var scrollHeight = Math.max($(document).height(), $(document.body).height())
82
84
 
83
85
  if (typeof offset != 'object') offsetBottom = offsetTop = offset
84
86
  if (typeof offsetTop == 'function') offsetTop = offset.top(this.$element)
@@ -1,8 +1,8 @@
1
1
  /* ========================================================================
2
- * Bootstrap: alert.js v3.3.0
3
- * http://getbootstrap.com/javascript/#alerts
2
+ * Bootstrap: alert.js v3.4.1
3
+ * https://getbootstrap.com/docs/3.4/javascript/#alerts
4
4
  * ========================================================================
5
- * Copyright 2011-2014 Twitter, Inc.
5
+ * Copyright 2011-2019 Twitter, Inc.
6
6
  * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
7
7
  * ======================================================================== */
8
8
 
@@ -18,7 +18,7 @@
18
18
  $(el).on('click', dismiss, this.close)
19
19
  }
20
20
 
21
- Alert.VERSION = '3.3.0'
21
+ Alert.VERSION = '3.4.1'
22
22
 
23
23
  Alert.TRANSITION_DURATION = 150
24
24
 
@@ -31,7 +31,8 @@
31
31
  selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') // strip for ie7
32
32
  }
33
33
 
34
- var $parent = $(selector)
34
+ selector = selector === '#' ? [] : selector
35
+ var $parent = $(document).find(selector)
35
36
 
36
37
  if (e) e.preventDefault()
37
38
 
@@ -1,8 +1,8 @@
1
1
  /* ========================================================================
2
- * Bootstrap: button.js v3.3.0
3
- * http://getbootstrap.com/javascript/#buttons
2
+ * Bootstrap: button.js v3.4.1
3
+ * https://getbootstrap.com/docs/3.4/javascript/#buttons
4
4
  * ========================================================================
5
- * Copyright 2011-2014 Twitter, Inc.
5
+ * Copyright 2011-2019 Twitter, Inc.
6
6
  * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
7
7
  * ======================================================================== */
8
8
 
@@ -19,7 +19,7 @@
19
19
  this.isLoading = false
20
20
  }
21
21
 
22
- Button.VERSION = '3.3.0'
22
+ Button.VERSION = '3.4.1'
23
23
 
24
24
  Button.DEFAULTS = {
25
25
  loadingText: 'loading...'
@@ -31,7 +31,7 @@
31
31
  var val = $el.is('input') ? 'val' : 'html'
32
32
  var data = $el.data()
33
33
 
34
- state = state + 'Text'
34
+ state += 'Text'
35
35
 
36
36
  if (data.resetText == null) $el.data('resetText', $el[val]())
37
37
 
@@ -41,10 +41,10 @@
41
41
 
42
42
  if (state == 'loadingText') {
43
43
  this.isLoading = true
44
- $el.addClass(d).attr(d, d)
44
+ $el.addClass(d).attr(d, d).prop(d, true)
45
45
  } else if (this.isLoading) {
46
46
  this.isLoading = false
47
- $el.removeClass(d).removeAttr(d)
47
+ $el.removeClass(d).removeAttr(d).prop(d, false)
48
48
  }
49
49
  }, this), 0)
50
50
  }
@@ -56,15 +56,19 @@
56
56
  if ($parent.length) {
57
57
  var $input = this.$element.find('input')
58
58
  if ($input.prop('type') == 'radio') {
59
- if ($input.prop('checked') && this.$element.hasClass('active')) changed = false
60
- else $parent.find('.active').removeClass('active')
59
+ if ($input.prop('checked')) changed = false
60
+ $parent.find('.active').removeClass('active')
61
+ this.$element.addClass('active')
62
+ } else if ($input.prop('type') == 'checkbox') {
63
+ if (($input.prop('checked')) !== this.$element.hasClass('active')) changed = false
64
+ this.$element.toggleClass('active')
61
65
  }
62
- if (changed) $input.prop('checked', !this.$element.hasClass('active')).trigger('change')
66
+ $input.prop('checked', this.$element.hasClass('active'))
67
+ if (changed) $input.trigger('change')
63
68
  } else {
64
69
  this.$element.attr('aria-pressed', !this.$element.hasClass('active'))
70
+ this.$element.toggleClass('active')
65
71
  }
66
-
67
- if (changed) this.$element.toggleClass('active')
68
72
  }
69
73
 
70
74
 
@@ -104,13 +108,18 @@
104
108
 
105
109
  $(document)
106
110
  .on('click.bs.button.data-api', '[data-toggle^="button"]', function (e) {
107
- var $btn = $(e.target)
108
- if (!$btn.hasClass('btn')) $btn = $btn.closest('.btn')
111
+ var $btn = $(e.target).closest('.btn')
109
112
  Plugin.call($btn, 'toggle')
110
- e.preventDefault()
113
+ if (!($(e.target).is('input[type="radio"], input[type="checkbox"]'))) {
114
+ // Prevent double click on radios, and the double selections (so cancellation) on checkboxes
115
+ e.preventDefault()
116
+ // The target component still receive the focus
117
+ if ($btn.is('input,button')) $btn.trigger('focus')
118
+ else $btn.find('input:visible,button:visible').first().trigger('focus')
119
+ }
111
120
  })
112
121
  .on('focus.bs.button.data-api blur.bs.button.data-api', '[data-toggle^="button"]', function (e) {
113
- $(e.target).closest('.btn').toggleClass('focus', e.type == 'focus')
122
+ $(e.target).closest('.btn').toggleClass('focus', /^focus(in)?$/.test(e.type))
114
123
  })
115
124
 
116
125
  }(jQuery);
@@ -1,8 +1,8 @@
1
1
  /* ========================================================================
2
- * Bootstrap: carousel.js v3.3.0
3
- * http://getbootstrap.com/javascript/#carousel
2
+ * Bootstrap: carousel.js v3.4.1
3
+ * https://getbootstrap.com/docs/3.4/javascript/#carousel
4
4
  * ========================================================================
5
- * Copyright 2011-2014 Twitter, Inc.
5
+ * Copyright 2011-2019 Twitter, Inc.
6
6
  * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
7
7
  * ======================================================================== */
8
8
 
@@ -17,10 +17,10 @@
17
17
  this.$element = $(element)
18
18
  this.$indicators = this.$element.find('.carousel-indicators')
19
19
  this.options = options
20
- this.paused =
21
- this.sliding =
22
- this.interval =
23
- this.$active =
20
+ this.paused = null
21
+ this.sliding = null
22
+ this.interval = null
23
+ this.$active = null
24
24
  this.$items = null
25
25
 
26
26
  this.options.keyboard && this.$element.on('keydown.bs.carousel', $.proxy(this.keydown, this))
@@ -30,7 +30,7 @@
30
30
  .on('mouseleave.bs.carousel', $.proxy(this.cycle, this))
31
31
  }
32
32
 
33
- Carousel.VERSION = '3.3.0'
33
+ Carousel.VERSION = '3.4.1'
34
34
 
35
35
  Carousel.TRANSITION_DURATION = 600
36
36
 
@@ -42,6 +42,7 @@
42
42
  }
43
43
 
44
44
  Carousel.prototype.keydown = function (e) {
45
+ if (/input|textarea/i.test(e.target.tagName)) return
45
46
  switch (e.which) {
46
47
  case 37: this.prev(); break
47
48
  case 39: this.next(); break
@@ -69,8 +70,11 @@
69
70
  }
70
71
 
71
72
  Carousel.prototype.getItemForDirection = function (direction, active) {
72
- var delta = direction == 'prev' ? -1 : 1
73
73
  var activeIndex = this.getItemIndex(active)
74
+ var willWrap = (direction == 'prev' && activeIndex === 0)
75
+ || (direction == 'next' && activeIndex == (this.$items.length - 1))
76
+ if (willWrap && !this.options.wrap) return active
77
+ var delta = direction == 'prev' ? -1 : 1
74
78
  var itemIndex = (activeIndex + delta) % this.$items.length
75
79
  return this.$items.eq(itemIndex)
76
80
  }
@@ -115,14 +119,8 @@
115
119
  var $next = next || this.getItemForDirection(type, $active)
116
120
  var isCycling = this.interval
117
121
  var direction = type == 'next' ? 'left' : 'right'
118
- var fallback = type == 'next' ? 'first' : 'last'
119
122
  var that = this
120
123
 
121
- if (!$next.length) {
122
- if (!this.options.wrap) return
123
- $next = this.$element.find('.item')[fallback]()
124
- }
125
-
126
124
  if ($next.hasClass('active')) return (this.sliding = false)
127
125
 
128
126
  var relatedTarget = $next[0]
@@ -146,7 +144,9 @@
146
144
  var slidEvent = $.Event('slid.bs.carousel', { relatedTarget: relatedTarget, direction: direction }) // yes, "slid"
147
145
  if ($.support.transition && this.$element.hasClass('slide')) {
148
146
  $next.addClass(type)
149
- $next[0].offsetWidth // force reflow
147
+ if (typeof $next === 'object' && $next.length) {
148
+ $next[0].offsetWidth // force reflow
149
+ }
150
150
  $active.addClass(direction)
151
151
  $next.addClass(direction)
152
152
  $active
@@ -208,10 +208,17 @@
208
208
  // =================
209
209
 
210
210
  var clickHandler = function (e) {
211
- var href
212
211
  var $this = $(this)
213
- var $target = $($this.attr('data-target') || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '')) // strip for ie7
212
+ var href = $this.attr('href')
213
+ if (href) {
214
+ href = href.replace(/.*(?=#[^\s]+$)/, '') // strip for ie7
215
+ }
216
+
217
+ var target = $this.attr('data-target') || href
218
+ var $target = $(document).find(target)
219
+
214
220
  if (!$target.hasClass('carousel')) return
221
+
215
222
  var options = $.extend({}, $target.data(), $this.data())
216
223
  var slideIndex = $this.attr('data-slide-to')
217
224
  if (slideIndex) options.interval = false
@@ -1,11 +1,12 @@
1
1
  /* ========================================================================
2
- * Bootstrap: collapse.js v3.3.0
3
- * http://getbootstrap.com/javascript/#collapse
2
+ * Bootstrap: collapse.js v3.4.1
3
+ * https://getbootstrap.com/docs/3.4/javascript/#collapse
4
4
  * ========================================================================
5
- * Copyright 2011-2014 Twitter, Inc.
5
+ * Copyright 2011-2019 Twitter, Inc.
6
6
  * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
7
7
  * ======================================================================== */
8
8
 
9
+ /* jshint latedef: false */
9
10
 
10
11
  +function ($) {
11
12
  'use strict';
@@ -16,7 +17,8 @@
16
17
  var Collapse = function (element, options) {
17
18
  this.$element = $(element)
18
19
  this.options = $.extend({}, Collapse.DEFAULTS, options)
19
- this.$trigger = $(this.options.trigger).filter('[href="#' + element.id + '"], [data-target="#' + element.id + '"]')
20
+ this.$trigger = $('[data-toggle="collapse"][href="#' + element.id + '"],' +
21
+ '[data-toggle="collapse"][data-target="#' + element.id + '"]')
20
22
  this.transitioning = null
21
23
 
22
24
  if (this.options.parent) {
@@ -28,13 +30,12 @@
28
30
  if (this.options.toggle) this.toggle()
29
31
  }
30
32
 
31
- Collapse.VERSION = '3.3.0'
33
+ Collapse.VERSION = '3.4.1'
32
34
 
33
35
  Collapse.TRANSITION_DURATION = 350
34
36
 
35
37
  Collapse.DEFAULTS = {
36
- toggle: true,
37
- trigger: '[data-toggle="collapse"]'
38
+ toggle: true
38
39
  }
39
40
 
40
41
  Collapse.prototype.dimension = function () {
@@ -46,7 +47,7 @@
46
47
  if (this.transitioning || this.$element.hasClass('in')) return
47
48
 
48
49
  var activesData
49
- var actives = this.$parent && this.$parent.find('> .panel').children('.in, .collapsing')
50
+ var actives = this.$parent && this.$parent.children('.panel').children('.in, .collapsing')
50
51
 
51
52
  if (actives && actives.length) {
52
53
  activesData = actives.data('bs.collapse')
@@ -136,7 +137,7 @@
136
137
  }
137
138
 
138
139
  Collapse.prototype.getParent = function () {
139
- return $(this.options.parent)
140
+ return $(document).find(this.options.parent)
140
141
  .find('[data-toggle="collapse"][data-parent="' + this.options.parent + '"]')
141
142
  .each($.proxy(function (i, element) {
142
143
  var $element = $(element)
@@ -159,7 +160,7 @@
159
160
  var target = $trigger.attr('data-target')
160
161
  || (href = $trigger.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '') // strip for ie7
161
162
 
162
- return $(target)
163
+ return $(document).find(target)
163
164
  }
164
165
 
165
166
 
@@ -172,7 +173,7 @@
172
173
  var data = $this.data('bs.collapse')
173
174
  var options = $.extend({}, Collapse.DEFAULTS, $this.data(), typeof option == 'object' && option)
174
175
 
175
- if (!data && options.toggle && option == 'show') options.toggle = false
176
+ if (!data && options.toggle && /show|hide/.test(option)) options.toggle = false
176
177
  if (!data) $this.data('bs.collapse', (data = new Collapse(this, options)))
177
178
  if (typeof option == 'string') data[option]()
178
179
  })
@@ -203,7 +204,7 @@
203
204
 
204
205
  var $target = getTargetFromTrigger($this)
205
206
  var data = $target.data('bs.collapse')
206
- var option = data ? 'toggle' : $.extend({}, $this.data(), { trigger: this })
207
+ var option = data ? 'toggle' : $this.data()
207
208
 
208
209
  Plugin.call($target, option)
209
210
  })
@@ -1,8 +1,8 @@
1
1
  /* ========================================================================
2
- * Bootstrap: dropdown.js v3.3.0
3
- * http://getbootstrap.com/javascript/#dropdowns
2
+ * Bootstrap: dropdown.js v3.4.1
3
+ * https://getbootstrap.com/docs/3.4/javascript/#dropdowns
4
4
  * ========================================================================
5
- * Copyright 2011-2014 Twitter, Inc.
5
+ * Copyright 2011-2019 Twitter, Inc.
6
6
  * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
7
7
  * ======================================================================== */
8
8
 
@@ -19,7 +19,41 @@
19
19
  $(element).on('click.bs.dropdown', this.toggle)
20
20
  }
21
21
 
22
- Dropdown.VERSION = '3.3.0'
22
+ Dropdown.VERSION = '3.4.1'
23
+
24
+ function getParent($this) {
25
+ var selector = $this.attr('data-target')
26
+
27
+ if (!selector) {
28
+ selector = $this.attr('href')
29
+ selector = selector && /#[A-Za-z]/.test(selector) && selector.replace(/.*(?=#[^\s]*$)/, '') // strip for ie7
30
+ }
31
+
32
+ var $parent = selector !== '#' ? $(document).find(selector) : null
33
+
34
+ return $parent && $parent.length ? $parent : $this.parent()
35
+ }
36
+
37
+ function clearMenus(e) {
38
+ if (e && e.which === 3) return
39
+ $(backdrop).remove()
40
+ $(toggle).each(function () {
41
+ var $this = $(this)
42
+ var $parent = getParent($this)
43
+ var relatedTarget = { relatedTarget: this }
44
+
45
+ if (!$parent.hasClass('open')) return
46
+
47
+ if (e && e.type == 'click' && /input|textarea/i.test(e.target.tagName) && $.contains($parent[0], e.target)) return
48
+
49
+ $parent.trigger(e = $.Event('hide.bs.dropdown', relatedTarget))
50
+
51
+ if (e.isDefaultPrevented()) return
52
+
53
+ $this.attr('aria-expanded', 'false')
54
+ $parent.removeClass('open').trigger($.Event('hidden.bs.dropdown', relatedTarget))
55
+ })
56
+ }
23
57
 
24
58
  Dropdown.prototype.toggle = function (e) {
25
59
  var $this = $(this)
@@ -34,7 +68,10 @@
34
68
  if (!isActive) {
35
69
  if ('ontouchstart' in document.documentElement && !$parent.closest('.navbar-nav').length) {
36
70
  // if mobile we use a backdrop because click events don't delegate
37
- $('<div class="dropdown-backdrop"/>').insertAfter($(this)).on('click', clearMenus)
71
+ $(document.createElement('div'))
72
+ .addClass('dropdown-backdrop')
73
+ .insertAfter($(this))
74
+ .on('click', clearMenus)
38
75
  }
39
76
 
40
77
  var relatedTarget = { relatedTarget: this }
@@ -48,14 +85,14 @@
48
85
 
49
86
  $parent
50
87
  .toggleClass('open')
51
- .trigger('shown.bs.dropdown', relatedTarget)
88
+ .trigger($.Event('shown.bs.dropdown', relatedTarget))
52
89
  }
53
90
 
54
91
  return false
55
92
  }
56
93
 
57
94
  Dropdown.prototype.keydown = function (e) {
58
- if (!/(38|40|27|32)/.test(e.which)) return
95
+ if (!/(38|40|27|32)/.test(e.which) || /input|textarea/i.test(e.target.tagName)) return
59
96
 
60
97
  var $this = $(this)
61
98
 
@@ -67,57 +104,25 @@
67
104
  var $parent = getParent($this)
68
105
  var isActive = $parent.hasClass('open')
69
106
 
70
- if ((!isActive && e.which != 27) || (isActive && e.which == 27)) {
107
+ if (!isActive && e.which != 27 || isActive && e.which == 27) {
71
108
  if (e.which == 27) $parent.find(toggle).trigger('focus')
72
109
  return $this.trigger('click')
73
110
  }
74
111
 
75
- var desc = ' li:not(.divider):visible a'
76
- var $items = $parent.find('[role="menu"]' + desc + ', [role="listbox"]' + desc)
112
+ var desc = ' li:not(.disabled):visible a'
113
+ var $items = $parent.find('.dropdown-menu' + desc)
77
114
 
78
115
  if (!$items.length) return
79
116
 
80
117
  var index = $items.index(e.target)
81
118
 
82
- if (e.which == 38 && index > 0) index-- // up
83
- if (e.which == 40 && index < $items.length - 1) index++ // down
84
- if (!~index) index = 0
119
+ if (e.which == 38 && index > 0) index-- // up
120
+ if (e.which == 40 && index < $items.length - 1) index++ // down
121
+ if (!~index) index = 0
85
122
 
86
123
  $items.eq(index).trigger('focus')
87
124
  }
88
125
 
89
- function clearMenus(e) {
90
- if (e && e.which === 3) return
91
- $(backdrop).remove()
92
- $(toggle).each(function () {
93
- var $this = $(this)
94
- var $parent = getParent($this)
95
- var relatedTarget = { relatedTarget: this }
96
-
97
- if (!$parent.hasClass('open')) return
98
-
99
- $parent.trigger(e = $.Event('hide.bs.dropdown', relatedTarget))
100
-
101
- if (e.isDefaultPrevented()) return
102
-
103
- $this.attr('aria-expanded', 'false')
104
- $parent.removeClass('open').trigger('hidden.bs.dropdown', relatedTarget)
105
- })
106
- }
107
-
108
- function getParent($this) {
109
- var selector = $this.attr('data-target')
110
-
111
- if (!selector) {
112
- selector = $this.attr('href')
113
- selector = selector && /#[A-Za-z]/.test(selector) && selector.replace(/.*(?=#[^\s]*$)/, '') // strip for ie7
114
- }
115
-
116
- var $parent = selector && $(selector)
117
-
118
- return $parent && $parent.length ? $parent : $this.parent()
119
- }
120
-
121
126
 
122
127
  // DROPDOWN PLUGIN DEFINITION
123
128
  // ==========================
@@ -155,7 +160,6 @@
155
160
  .on('click.bs.dropdown.data-api', '.dropdown form', function (e) { e.stopPropagation() })
156
161
  .on('click.bs.dropdown.data-api', toggle, Dropdown.prototype.toggle)
157
162
  .on('keydown.bs.dropdown.data-api', toggle, Dropdown.prototype.keydown)
158
- .on('keydown.bs.dropdown.data-api', '[role="menu"]', Dropdown.prototype.keydown)
159
- .on('keydown.bs.dropdown.data-api', '[role="listbox"]', Dropdown.prototype.keydown)
163
+ .on('keydown.bs.dropdown.data-api', '.dropdown-menu', Dropdown.prototype.keydown)
160
164
 
161
165
  }(jQuery);