bootstrap-sass 3.3.1.0 → 3.4.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.gitignore +1 -0
- data/.travis.yml +8 -14
- data/CHANGELOG.md +55 -0
- data/CONTRIBUTING.md +8 -1
- data/Gemfile +1 -4
- data/LICENSE +2 -1
- data/README.md +118 -96
- data/Rakefile +58 -12
- data/assets/fonts/bootstrap/glyphicons-halflings-regular.eot +0 -0
- data/assets/fonts/bootstrap/glyphicons-halflings-regular.svg +273 -214
- data/assets/fonts/bootstrap/glyphicons-halflings-regular.ttf +0 -0
- data/assets/fonts/bootstrap/glyphicons-halflings-regular.woff +0 -0
- data/assets/fonts/bootstrap/glyphicons-halflings-regular.woff2 +0 -0
- data/assets/javascripts/bootstrap/affix.js +11 -9
- data/assets/javascripts/bootstrap/alert.js +6 -5
- data/assets/javascripts/bootstrap/button.js +24 -15
- data/assets/javascripts/bootstrap/carousel.js +24 -18
- data/assets/javascripts/bootstrap/collapse.js +13 -12
- data/assets/javascripts/bootstrap/dropdown.js +50 -46
- data/assets/javascripts/bootstrap/modal.js +77 -43
- data/assets/javascripts/bootstrap/popover.js +31 -27
- data/assets/javascripts/bootstrap/scrollspy.js +19 -22
- data/assets/javascripts/bootstrap/tab.js +14 -12
- data/assets/javascripts/bootstrap/tooltip.js +255 -56
- data/assets/javascripts/bootstrap/transition.js +5 -5
- data/assets/javascripts/bootstrap-sprockets.js +2 -2
- data/assets/javascripts/bootstrap.js +1280 -1004
- data/assets/javascripts/bootstrap.min.js +6 -0
- data/assets/stylesheets/_bootstrap-compass.scss +2 -0
- data/assets/stylesheets/_bootstrap-mincer.scss +4 -2
- data/assets/stylesheets/_bootstrap-sprockets.scss +2 -0
- data/assets/stylesheets/_bootstrap.scss +6 -0
- data/assets/stylesheets/bootstrap/_alerts.scss +8 -3
- data/assets/stylesheets/bootstrap/_badges.scss +9 -4
- data/assets/stylesheets/bootstrap/_breadcrumbs.scss +3 -1
- data/assets/stylesheets/bootstrap/_button-groups.scss +11 -10
- data/assets/stylesheets/bootstrap/_buttons.scss +18 -10
- data/assets/stylesheets/bootstrap/_carousel.scss +40 -36
- data/assets/stylesheets/bootstrap/_close.scss +2 -0
- data/assets/stylesheets/bootstrap/_code.scss +3 -3
- data/assets/stylesheets/bootstrap/_component-animations.scss +2 -2
- data/assets/stylesheets/bootstrap/_dropdowns.scss +24 -24
- data/assets/stylesheets/bootstrap/_forms.scss +143 -84
- data/assets/stylesheets/bootstrap/_glyphicons.scss +85 -12
- data/assets/stylesheets/bootstrap/_grid.scss +10 -0
- data/assets/stylesheets/bootstrap/_input-groups.scss +10 -5
- data/assets/stylesheets/bootstrap/_jumbotron.scss +9 -4
- data/assets/stylesheets/bootstrap/_labels.scss +1 -1
- data/assets/stylesheets/bootstrap/_list-group.scss +30 -26
- data/assets/stylesheets/bootstrap/_media.scss +19 -0
- data/assets/stylesheets/bootstrap/_mixins.scss +1 -0
- data/assets/stylesheets/bootstrap/_modals.scss +11 -9
- data/assets/stylesheets/bootstrap/_navbar.scss +76 -82
- data/assets/stylesheets/bootstrap/_navs.scss +4 -6
- data/assets/stylesheets/bootstrap/_normalize.scss +13 -13
- data/assets/stylesheets/bootstrap/_pager.scss +2 -2
- data/assets/stylesheets/bootstrap/_pagination.scss +15 -17
- data/assets/stylesheets/bootstrap/_panels.scss +16 -6
- data/assets/stylesheets/bootstrap/_popovers.scss +50 -59
- data/assets/stylesheets/bootstrap/_print.scss +90 -98
- data/assets/stylesheets/bootstrap/_progress-bars.scss +3 -3
- data/assets/stylesheets/bootstrap/_responsive-embed.scss +10 -10
- data/assets/stylesheets/bootstrap/_responsive-utilities.scss +11 -6
- data/assets/stylesheets/bootstrap/_scaffolding.scss +18 -7
- data/assets/stylesheets/bootstrap/_tables.scss +24 -24
- data/assets/stylesheets/bootstrap/_theme.scss +45 -22
- data/assets/stylesheets/bootstrap/_thumbnails.scss +1 -1
- data/assets/stylesheets/bootstrap/_tooltip.scss +42 -33
- data/assets/stylesheets/bootstrap/_type.scss +12 -12
- data/assets/stylesheets/bootstrap/_utilities.scss +0 -1
- data/assets/stylesheets/bootstrap/_variables.scss +27 -17
- data/assets/stylesheets/bootstrap/_wells.scss +2 -2
- data/assets/stylesheets/bootstrap/mixins/_alerts.scss +2 -1
- data/assets/stylesheets/bootstrap/mixins/_background-variant.scss +2 -1
- data/assets/stylesheets/bootstrap/mixins/_border-radius.scss +4 -4
- data/assets/stylesheets/bootstrap/mixins/_buttons.scss +20 -11
- data/assets/stylesheets/bootstrap/mixins/_center-block.scss +1 -1
- data/assets/stylesheets/bootstrap/mixins/_clearfix.scss +1 -1
- data/assets/stylesheets/bootstrap/mixins/_forms.scss +4 -4
- data/assets/stylesheets/bootstrap/mixins/_gradients.scss +6 -8
- data/assets/stylesheets/bootstrap/mixins/_grid-framework.scss +2 -2
- data/assets/stylesheets/bootstrap/mixins/_grid.scss +8 -8
- data/assets/stylesheets/bootstrap/mixins/_hide-text.scss +3 -3
- data/assets/stylesheets/bootstrap/mixins/_image.scss +5 -10
- data/assets/stylesheets/bootstrap/mixins/_list-group.scss +3 -2
- data/assets/stylesheets/bootstrap/mixins/_opacity.scss +2 -3
- data/assets/stylesheets/bootstrap/mixins/_pagination.scss +2 -1
- data/assets/stylesheets/bootstrap/mixins/_reset-text.scss +18 -0
- data/assets/stylesheets/bootstrap/mixins/_resize.scss +1 -1
- data/assets/stylesheets/bootstrap/mixins/_responsive-visibility.scss +1 -5
- data/assets/stylesheets/bootstrap/mixins/_tab-focus.scss +3 -3
- data/assets/stylesheets/bootstrap/mixins/_text-emphasis.scss +2 -1
- data/assets/stylesheets/bootstrap/mixins/_vendor-prefixes.scss +4 -4
- data/bootstrap-sass.gemspec +10 -9
- data/bower.json +6 -20
- data/composer.json +2 -2
- data/eyeglass-exports.js +7 -0
- data/lib/bootstrap-sass/engine.rb +6 -1
- data/lib/bootstrap-sass/version.rb +2 -2
- data/lib/bootstrap-sass.rb +32 -13
- data/package-lock.json +1611 -0
- data/package.json +21 -7
- data/sache.json +1 -1
- data/tasks/bower.rake +2 -5
- data/tasks/converter/fonts_conversion.rb +1 -1
- data/tasks/converter/js_conversion.rb +7 -5
- data/tasks/converter/less_conversion.rb +47 -36
- data/tasks/converter/network.rb +12 -7
- data/tasks/converter.rb +1 -1
- data/templates/project/_bootstrap-variables.sass +27 -18
- data/templates/project/styles.sass +3 -0
- data/test/compilation_test.rb +24 -12
- data/test/dummy_rails/app/assets/stylesheets/{application.css.sass → application.sass} +0 -0
- data/test/dummy_rails/app/views/pages/root.html.slim +43 -0
- data/test/dummy_rails/config/application.rb +2 -1
- data/test/dummy_rails/config/boot.rb +1 -1
- data/test/dummy_rails/config/environments/development.rb +0 -3
- data/test/dummy_rails/config/environments/production.rb +7 -1
- data/test/dummy_rails/config/environments/test.rb +9 -1
- data/test/dummy_sass_only/Gemfile +1 -1
- data/test/dummy_sass_only/compile.rb +14 -7
- data/test/dummy_sass_only/import_all.scss +2 -0
- data/test/gemfiles/default.gemfile +3 -0
- data/test/node_mincer_test.rb +2 -3
- data/test/node_sass_compile_test.sh +4 -3
- data/test/sass_test.rb +10 -7
- data/test/sprockets_rails_test.rb +12 -8
- data/test/support/dummy_rails_integration.rb +1 -1
- data/test/support/reporting.rb +10 -0
- data/test/test_helper.rb +3 -2
- metadata +56 -46
- data/test/compass_test.rb +0 -9
- data/test/dummy_rails/log/development.log +0 -0
- data/test/dummy_sass_only/import_all.sass +0 -2
- data/test/gemfiles/sass_3_2.gemfile +0 -6
- data/test/gemfiles/sass_3_3.gemfile +0 -6
- data/test/gemfiles/sass_3_4.gemfile +0 -7
- data/test/gemfiles/sass_head.gemfile +0 -6
Binary file
|
Binary file
|
Binary file
|
@@ -1,8 +1,8 @@
|
|
1
1
|
/* ========================================================================
|
2
|
-
* Bootstrap: affix.js v3.
|
3
|
-
*
|
2
|
+
* Bootstrap: affix.js v3.4.1
|
3
|
+
* https://getbootstrap.com/docs/3.4/javascript/#affix
|
4
4
|
* ========================================================================
|
5
|
-
* Copyright 2011-
|
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
|
-
|
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.
|
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 &&
|
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 = $(
|
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
|
-
*
|
2
|
+
* Bootstrap: alert.js v3.4.1
|
3
|
+
* https://getbootstrap.com/docs/3.4/javascript/#alerts
|
4
4
|
* ========================================================================
|
5
|
-
* Copyright 2011-
|
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.
|
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
|
-
|
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
|
-
*
|
2
|
+
* Bootstrap: button.js v3.4.1
|
3
|
+
* https://getbootstrap.com/docs/3.4/javascript/#buttons
|
4
4
|
* ========================================================================
|
5
|
-
* Copyright 2011-
|
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.
|
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
|
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')
|
60
|
-
|
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
|
-
|
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,10 +108,15 @@
|
|
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.
|
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
122
|
$(e.target).closest('.btn').toggleClass('focus', /^focus(in)?$/.test(e.type))
|
@@ -1,8 +1,8 @@
|
|
1
1
|
/* ========================================================================
|
2
|
-
* Bootstrap: carousel.js v3.
|
3
|
-
*
|
2
|
+
* Bootstrap: carousel.js v3.4.1
|
3
|
+
* https://getbootstrap.com/docs/3.4/javascript/#carousel
|
4
4
|
* ========================================================================
|
5
|
-
* Copyright 2011-
|
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.
|
33
|
+
Carousel.VERSION = '3.4.1'
|
34
34
|
|
35
35
|
Carousel.TRANSITION_DURATION = 600
|
36
36
|
|
@@ -70,8 +70,11 @@
|
|
70
70
|
}
|
71
71
|
|
72
72
|
Carousel.prototype.getItemForDirection = function (direction, active) {
|
73
|
-
var delta = direction == 'prev' ? -1 : 1
|
74
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
|
75
78
|
var itemIndex = (activeIndex + delta) % this.$items.length
|
76
79
|
return this.$items.eq(itemIndex)
|
77
80
|
}
|
@@ -116,14 +119,8 @@
|
|
116
119
|
var $next = next || this.getItemForDirection(type, $active)
|
117
120
|
var isCycling = this.interval
|
118
121
|
var direction = type == 'next' ? 'left' : 'right'
|
119
|
-
var fallback = type == 'next' ? 'first' : 'last'
|
120
122
|
var that = this
|
121
123
|
|
122
|
-
if (!$next.length) {
|
123
|
-
if (!this.options.wrap) return
|
124
|
-
$next = this.$element.find('.item')[fallback]()
|
125
|
-
}
|
126
|
-
|
127
124
|
if ($next.hasClass('active')) return (this.sliding = false)
|
128
125
|
|
129
126
|
var relatedTarget = $next[0]
|
@@ -147,7 +144,9 @@
|
|
147
144
|
var slidEvent = $.Event('slid.bs.carousel', { relatedTarget: relatedTarget, direction: direction }) // yes, "slid"
|
148
145
|
if ($.support.transition && this.$element.hasClass('slide')) {
|
149
146
|
$next.addClass(type)
|
150
|
-
$next
|
147
|
+
if (typeof $next === 'object' && $next.length) {
|
148
|
+
$next[0].offsetWidth // force reflow
|
149
|
+
}
|
151
150
|
$active.addClass(direction)
|
152
151
|
$next.addClass(direction)
|
153
152
|
$active
|
@@ -209,10 +208,17 @@
|
|
209
208
|
// =================
|
210
209
|
|
211
210
|
var clickHandler = function (e) {
|
212
|
-
var href
|
213
211
|
var $this = $(this)
|
214
|
-
var
|
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
|
+
|
215
220
|
if (!$target.hasClass('carousel')) return
|
221
|
+
|
216
222
|
var options = $.extend({}, $target.data(), $this.data())
|
217
223
|
var slideIndex = $this.attr('data-slide-to')
|
218
224
|
if (slideIndex) options.interval = false
|
@@ -1,11 +1,12 @@
|
|
1
1
|
/* ========================================================================
|
2
|
-
* Bootstrap: collapse.js v3.
|
3
|
-
*
|
2
|
+
* Bootstrap: collapse.js v3.4.1
|
3
|
+
* https://getbootstrap.com/docs/3.4/javascript/#collapse
|
4
4
|
* ========================================================================
|
5
|
-
* Copyright 2011-
|
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 = $(
|
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.
|
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.
|
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
|
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' :
|
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
|
-
*
|
2
|
+
* Bootstrap: dropdown.js v3.4.1
|
3
|
+
* https://getbootstrap.com/docs/3.4/javascript/#dropdowns
|
4
4
|
* ========================================================================
|
5
|
-
* Copyright 2011-
|
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.
|
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
|
-
$('
|
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,7 +85,7 @@
|
|
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
|
@@ -67,57 +104,25 @@
|
|
67
104
|
var $parent = getParent($this)
|
68
105
|
var isActive = $parent.hasClass('open')
|
69
106
|
|
70
|
-
if (
|
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(.
|
76
|
-
var $items = $parent.find('
|
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--
|
83
|
-
if (e.which == 40 && index < $items.length - 1) index++
|
84
|
-
if (!~index)
|
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', '
|
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);
|