twbs_less_rails 2.7.2 → 2.8.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (47) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +9 -0
  3. data/LICENSE +1 -1
  4. data/README.md +1 -1
  5. data/lib/twbs_less_rails/version.rb +1 -1
  6. data/vendor/assets/javascripts/twbs/bootstrap/affix.js +34 -23
  7. data/vendor/assets/javascripts/twbs/bootstrap/alert.js +5 -15
  8. data/vendor/assets/javascripts/twbs/bootstrap/button.js +21 -29
  9. data/vendor/assets/javascripts/twbs/bootstrap/carousel.js +16 -28
  10. data/vendor/assets/javascripts/twbs/bootstrap/collapse.js +7 -16
  11. data/vendor/assets/javascripts/twbs/bootstrap/dropdown.js +19 -26
  12. data/vendor/assets/javascripts/twbs/bootstrap/modal.js +25 -28
  13. data/vendor/assets/javascripts/twbs/bootstrap/popover.js +14 -21
  14. data/vendor/assets/javascripts/twbs/bootstrap/scrollspy.js +16 -21
  15. data/vendor/assets/javascripts/twbs/bootstrap/tab.js +7 -17
  16. data/vendor/assets/javascripts/twbs/bootstrap/tooltip.js +52 -39
  17. data/vendor/assets/javascripts/twbs/bootstrap/transition.js +11 -19
  18. data/vendor/assets/stylesheets/twbs/bootstrap/badges.less +4 -0
  19. data/vendor/assets/stylesheets/twbs/bootstrap/breadcrumbs.less +4 -1
  20. data/vendor/assets/stylesheets/twbs/bootstrap/button-groups.less +10 -11
  21. data/vendor/assets/stylesheets/twbs/bootstrap/buttons.less +8 -8
  22. data/vendor/assets/stylesheets/twbs/bootstrap/code.less +10 -0
  23. data/vendor/assets/stylesheets/twbs/bootstrap/dropdowns.less +28 -2
  24. data/vendor/assets/stylesheets/twbs/bootstrap/forms.less +82 -38
  25. data/vendor/assets/stylesheets/twbs/bootstrap/glyphicons.less +1 -5
  26. data/vendor/assets/stylesheets/twbs/bootstrap/grid.less +26 -5
  27. data/vendor/assets/stylesheets/twbs/bootstrap/input-groups.less +39 -18
  28. data/vendor/assets/stylesheets/twbs/bootstrap/jumbotron.less +3 -5
  29. data/vendor/assets/stylesheets/twbs/bootstrap/list-group.less +25 -3
  30. data/vendor/assets/stylesheets/twbs/bootstrap/mixins.less +130 -49
  31. data/vendor/assets/stylesheets/twbs/bootstrap/modals.less +16 -7
  32. data/vendor/assets/stylesheets/twbs/bootstrap/navbar.less +24 -20
  33. data/vendor/assets/stylesheets/twbs/bootstrap/navs.less +2 -2
  34. data/vendor/assets/stylesheets/twbs/bootstrap/normalize.less +139 -122
  35. data/vendor/assets/stylesheets/twbs/bootstrap/pager.less +5 -5
  36. data/vendor/assets/stylesheets/twbs/bootstrap/pagination.less +6 -3
  37. data/vendor/assets/stylesheets/twbs/bootstrap/panels.less +64 -16
  38. data/vendor/assets/stylesheets/twbs/bootstrap/print.less +0 -4
  39. data/vendor/assets/stylesheets/twbs/bootstrap/responsive-utilities.less +13 -129
  40. data/vendor/assets/stylesheets/twbs/bootstrap/scaffolding.less +17 -2
  41. data/vendor/assets/stylesheets/twbs/bootstrap/tables.less +3 -1
  42. data/vendor/assets/stylesheets/twbs/bootstrap/theme.less +1 -1
  43. data/vendor/assets/stylesheets/twbs/bootstrap/tooltip.less +1 -1
  44. data/vendor/assets/stylesheets/twbs/bootstrap/type.less +78 -63
  45. data/vendor/assets/stylesheets/twbs/bootstrap/variables.less +346 -161
  46. data/vendor/assets/stylesheets/twbs/bootstrap/wells.less +1 -1
  47. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 7b1421b03d1cb2f7bff40990889fb05155e14278
4
- data.tar.gz: ac4dd679c54d1769e878d2a8a4e15c34426fcb7d
3
+ metadata.gz: c7442e8f4ac4417fc99b6a58f0fd40223f750ba1
4
+ data.tar.gz: 489faa88d524bc01f4673e0cd1ef0f50d5c9ace9
5
5
  SHA512:
6
- metadata.gz: 2e27653afd55dac575b8e86096622f8ef134022f5dbf971d7d39f31ee811ea82de1a0b57f3cfc2120ed9233c35dbb4a83a423ba04bf032831912d92d32d50c59
7
- data.tar.gz: e33d3cc660cdb977eee5e0edbb0ececc40d6d17d210614f917139d38b06aa4bd4a70bda9abcd82570b6ee8a1a5123d7f72ca88037cd564cf37278e6a594917ae
6
+ metadata.gz: f0ee0e99b23ef85b34851a459a71995b5fbd693922377a4e82a62e8aeb180df4a08bba85c79c3c895ce8137d3d92bfab52c632ee5f6f4be894298d6ccd22b9de
7
+ data.tar.gz: e92565c76936f68ad606f48fd3ed6a7482450bff064edc08681dd71128f19bda3bc383d7c12f4743ec8bde3e4a4827f5c1b0301a72958b542ab07738da6bf93f
data/CHANGELOG.md CHANGED
@@ -1,5 +1,14 @@
1
1
  # Changelog
2
2
 
3
+ ## 2.8.1
4
+
5
+ * Fixed gem version number
6
+
7
+ ## 2.8.0
8
+
9
+ * Bootstrap v3.1.0
10
+ * Updated Bootstrap license to MIT
11
+
3
12
  ## 2.7.2
4
13
 
5
14
  * Reformatted changelog
data/LICENSE CHANGED
@@ -21,7 +21,7 @@ ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
21
21
  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
22
22
  SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
23
23
 
24
- Twitter Bootstrap is licensed under the Apache License, Version 2.0
24
+ Twitter Bootstrap is licensed under the MIT License
25
25
 
26
26
  Font Awesome is licensed under the MIT License
27
27
 
data/README.md CHANGED
@@ -148,7 +148,7 @@ For more information on SemVer, please visit [http://semver.org/](http://semver.
148
148
 
149
149
  Copyright 2014 diowa under [the BSD 2-Clause license](LICENSE).
150
150
 
151
- Twitter Bootstrap is licensed under the Apache License, Version 2.0
151
+ Twitter Bootstrap is licensed under the MIT License
152
152
 
153
153
  Font Awesome is licensed under the MIT License
154
154
 
@@ -1,3 +1,3 @@
1
1
  module TwbsLessRails
2
- VERSION = "2.7.2"
2
+ VERSION = "2.8.1"
3
3
  end
@@ -1,24 +1,14 @@
1
1
  /* ========================================================================
2
- * Bootstrap: affix.js v3.0.3
2
+ * Bootstrap: affix.js v3.1.0
3
3
  * http://getbootstrap.com/javascript/#affix
4
4
  * ========================================================================
5
- * Copyright 2013 Twitter, Inc.
6
- *
7
- * Licensed under the Apache License, Version 2.0 (the "License");
8
- * you may not use this file except in compliance with the License.
9
- * You may obtain a copy of the License at
10
- *
11
- * http://www.apache.org/licenses/LICENSE-2.0
12
- *
13
- * Unless required by applicable law or agreed to in writing, software
14
- * distributed under the License is distributed on an "AS IS" BASIS,
15
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16
- * See the License for the specific language governing permissions and
17
- * limitations under the License.
5
+ * Copyright 2011-2014 Twitter, Inc.
6
+ * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
18
7
  * ======================================================================== */
19
8
 
20
9
 
21
- +function ($) { "use strict";
10
+ +function ($) {
11
+ 'use strict';
22
12
 
23
13
  // AFFIX CLASS DEFINITION
24
14
  // ======================
@@ -29,9 +19,10 @@
29
19
  .on('scroll.bs.affix.data-api', $.proxy(this.checkPosition, this))
30
20
  .on('click.bs.affix.data-api', $.proxy(this.checkPositionWithEventLoop, this))
31
21
 
32
- this.$element = $(element)
33
- this.affixed =
34
- this.unpin = null
22
+ this.$element = $(element)
23
+ this.affixed =
24
+ this.unpin =
25
+ this.pinnedOffset = null
35
26
 
36
27
  this.checkPosition()
37
28
  }
@@ -42,6 +33,14 @@
42
33
  offset: 0
43
34
  }
44
35
 
36
+ Affix.prototype.getPinnedOffset = function () {
37
+ if (this.pinnedOffset) return this.pinnedOffset
38
+ this.$element.removeClass(Affix.RESET).addClass('affix')
39
+ var scrollTop = this.$window.scrollTop()
40
+ var position = this.$element.offset()
41
+ return (this.pinnedOffset = position.top - scrollTop)
42
+ }
43
+
45
44
  Affix.prototype.checkPositionWithEventLoop = function () {
46
45
  setTimeout($.proxy(this.checkPosition, this), 1)
47
46
  }
@@ -56,9 +55,11 @@
56
55
  var offsetTop = offset.top
57
56
  var offsetBottom = offset.bottom
58
57
 
58
+ if (this.affixed == 'top') position.top += scrollTop
59
+
59
60
  if (typeof offset != 'object') offsetBottom = offsetTop = offset
60
- if (typeof offsetTop == 'function') offsetTop = offset.top()
61
- if (typeof offsetBottom == 'function') offsetBottom = offset.bottom()
61
+ if (typeof offsetTop == 'function') offsetTop = offset.top(this.$element)
62
+ if (typeof offsetBottom == 'function') offsetBottom = offset.bottom(this.$element)
62
63
 
63
64
  var affix = this.unpin != null && (scrollTop + this.unpin <= position.top) ? false :
64
65
  offsetBottom != null && (position.top + this.$element.height() >= scrollHeight - offsetBottom) ? 'bottom' :
@@ -67,13 +68,23 @@
67
68
  if (this.affixed === affix) return
68
69
  if (this.unpin) this.$element.css('top', '')
69
70
 
71
+ var affixType = 'affix' + (affix ? '-' + affix : '')
72
+ var e = $.Event(affixType + '.bs.affix')
73
+
74
+ this.$element.trigger(e)
75
+
76
+ if (e.isDefaultPrevented()) return
77
+
70
78
  this.affixed = affix
71
- this.unpin = affix == 'bottom' ? position.top - scrollTop : null
79
+ this.unpin = affix == 'bottom' ? this.getPinnedOffset() : null
72
80
 
73
- this.$element.removeClass(Affix.RESET).addClass('affix' + (affix ? '-' + affix : ''))
81
+ this.$element
82
+ .removeClass(Affix.RESET)
83
+ .addClass(affixType)
84
+ .trigger($.Event(affixType.replace('affix', 'affixed')))
74
85
 
75
86
  if (affix == 'bottom') {
76
- this.$element.offset({ top: document.body.offsetHeight - offsetBottom - this.$element.height() })
87
+ this.$element.offset({ top: scrollHeight - offsetBottom - this.$element.height() })
77
88
  }
78
89
  }
79
90
 
@@ -1,24 +1,14 @@
1
1
  /* ========================================================================
2
- * Bootstrap: alert.js v3.0.3
2
+ * Bootstrap: alert.js v3.1.0
3
3
  * http://getbootstrap.com/javascript/#alerts
4
4
  * ========================================================================
5
- * Copyright 2013 Twitter, Inc.
6
- *
7
- * Licensed under the Apache License, Version 2.0 (the "License");
8
- * you may not use this file except in compliance with the License.
9
- * You may obtain a copy of the License at
10
- *
11
- * http://www.apache.org/licenses/LICENSE-2.0
12
- *
13
- * Unless required by applicable law or agreed to in writing, software
14
- * distributed under the License is distributed on an "AS IS" BASIS,
15
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16
- * See the License for the specific language governing permissions and
17
- * limitations under the License.
5
+ * Copyright 2011-2014 Twitter, Inc.
6
+ * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
18
7
  * ======================================================================== */
19
8
 
20
9
 
21
- +function ($) { "use strict";
10
+ +function ($) {
11
+ 'use strict';
22
12
 
23
13
  // ALERT CLASS DEFINITION
24
14
  // ======================
@@ -1,31 +1,22 @@
1
1
  /* ========================================================================
2
- * Bootstrap: button.js v3.0.3
2
+ * Bootstrap: button.js v3.1.0
3
3
  * http://getbootstrap.com/javascript/#buttons
4
4
  * ========================================================================
5
- * Copyright 2013 Twitter, Inc.
6
- *
7
- * Licensed under the Apache License, Version 2.0 (the "License");
8
- * you may not use this file except in compliance with the License.
9
- * You may obtain a copy of the License at
10
- *
11
- * http://www.apache.org/licenses/LICENSE-2.0
12
- *
13
- * Unless required by applicable law or agreed to in writing, software
14
- * distributed under the License is distributed on an "AS IS" BASIS,
15
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16
- * See the License for the specific language governing permissions and
17
- * limitations under the License.
5
+ * Copyright 2011-2014 Twitter, Inc.
6
+ * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
18
7
  * ======================================================================== */
19
8
 
20
9
 
21
- +function ($) { "use strict";
10
+ +function ($) {
11
+ 'use strict';
22
12
 
23
13
  // BUTTON PUBLIC CLASS DEFINITION
24
14
  // ==============================
25
15
 
26
16
  var Button = function (element, options) {
27
- this.$element = $(element)
28
- this.options = $.extend({}, Button.DEFAULTS, options)
17
+ this.$element = $(element)
18
+ this.options = $.extend({}, Button.DEFAULTS, options)
19
+ this.isLoading = false
29
20
  }
30
21
 
31
22
  Button.DEFAULTS = {
@@ -45,25 +36,26 @@
45
36
  $el[val](data[state] || this.options[state])
46
37
 
47
38
  // push to event loop to allow forms to submit
48
- setTimeout(function () {
49
- state == 'loadingText' ?
50
- $el.addClass(d).attr(d, d) :
51
- $el.removeClass(d).removeAttr(d);
52
- }, 0)
39
+ setTimeout($.proxy(function () {
40
+ if (state == 'loadingText') {
41
+ this.isLoading = true
42
+ $el.addClass(d).attr(d, d)
43
+ } else if (this.isLoading) {
44
+ this.isLoading = false
45
+ $el.removeClass(d).removeAttr(d)
46
+ }
47
+ }, this), 0)
53
48
  }
54
49
 
55
50
  Button.prototype.toggle = function () {
56
- var $parent = this.$element.closest('[data-toggle="buttons"]')
57
51
  var changed = true
52
+ var $parent = this.$element.closest('[data-toggle="buttons"]')
58
53
 
59
54
  if ($parent.length) {
60
55
  var $input = this.$element.find('input')
61
- if ($input.prop('type') === 'radio') {
62
- // see if clicking on current one
63
- if ($input.prop('checked') && this.$element.hasClass('active'))
64
- changed = false
65
- else
66
- $parent.find('.active').removeClass('active')
56
+ if ($input.prop('type') == 'radio') {
57
+ if ($input.prop('checked') && this.$element.hasClass('active')) changed = false
58
+ else $parent.find('.active').removeClass('active')
67
59
  }
68
60
  if (changed) $input.prop('checked', !this.$element.hasClass('active')).trigger('change')
69
61
  }
@@ -1,24 +1,14 @@
1
1
  /* ========================================================================
2
- * Bootstrap: carousel.js v3.0.3
2
+ * Bootstrap: carousel.js v3.1.0
3
3
  * http://getbootstrap.com/javascript/#carousel
4
4
  * ========================================================================
5
- * Copyright 2013 Twitter, Inc.
6
- *
7
- * Licensed under the Apache License, Version 2.0 (the "License");
8
- * you may not use this file except in compliance with the License.
9
- * You may obtain a copy of the License at
10
- *
11
- * http://www.apache.org/licenses/LICENSE-2.0
12
- *
13
- * Unless required by applicable law or agreed to in writing, software
14
- * distributed under the License is distributed on an "AS IS" BASIS,
15
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16
- * See the License for the specific language governing permissions and
17
- * limitations under the License.
5
+ * Copyright 2011-2014 Twitter, Inc.
6
+ * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
18
7
  * ======================================================================== */
19
8
 
20
9
 
21
- +function ($) { "use strict";
10
+ +function ($) {
11
+ 'use strict';
22
12
 
23
13
  // CAROUSEL CLASS DEFINITION
24
14
  // =========================
@@ -39,9 +29,9 @@
39
29
  }
40
30
 
41
31
  Carousel.DEFAULTS = {
42
- interval: 5000
43
- , pause: 'hover'
44
- , wrap: true
32
+ interval: 5000,
33
+ pause: 'hover',
34
+ wrap: true
45
35
  }
46
36
 
47
37
  Carousel.prototype.cycle = function (e) {
@@ -78,7 +68,7 @@
78
68
  Carousel.prototype.pause = function (e) {
79
69
  e || (this.paused = true)
80
70
 
81
- if (this.$element.find('.next, .prev').length && $.support.transition.end) {
71
+ if (this.$element.find('.next, .prev').length && $.support.transition) {
82
72
  this.$element.trigger($.support.transition.end)
83
73
  this.cycle(true)
84
74
  }
@@ -111,13 +101,15 @@
111
101
  $next = this.$element.find('.item')[fallback]()
112
102
  }
113
103
 
114
- this.sliding = true
115
-
116
- isCycling && this.pause()
104
+ if ($next.hasClass('active')) return this.sliding = false
117
105
 
118
106
  var e = $.Event('slide.bs.carousel', { relatedTarget: $next[0], direction: direction })
107
+ this.$element.trigger(e)
108
+ if (e.isDefaultPrevented()) return
119
109
 
120
- if ($next.hasClass('active')) return
110
+ this.sliding = true
111
+
112
+ isCycling && this.pause()
121
113
 
122
114
  if (this.$indicators.length) {
123
115
  this.$indicators.find('.active').removeClass('active')
@@ -128,8 +120,6 @@
128
120
  }
129
121
 
130
122
  if ($.support.transition && this.$element.hasClass('slide')) {
131
- this.$element.trigger(e)
132
- if (e.isDefaultPrevented()) return
133
123
  $next.addClass(type)
134
124
  $next[0].offsetWidth // force reflow
135
125
  $active.addClass(direction)
@@ -141,10 +131,8 @@
141
131
  that.sliding = false
142
132
  setTimeout(function () { that.$element.trigger('slid.bs.carousel') }, 0)
143
133
  })
144
- .emulateTransitionEnd(600)
134
+ .emulateTransitionEnd($active.css('transition-duration').slice(0, -1) * 1000)
145
135
  } else {
146
- this.$element.trigger(e)
147
- if (e.isDefaultPrevented()) return
148
136
  $active.removeClass('active')
149
137
  $next.addClass('active')
150
138
  this.sliding = false
@@ -1,24 +1,14 @@
1
1
  /* ========================================================================
2
- * Bootstrap: collapse.js v3.0.3
2
+ * Bootstrap: collapse.js v3.1.0
3
3
  * http://getbootstrap.com/javascript/#collapse
4
4
  * ========================================================================
5
- * Copyright 2013 Twitter, Inc.
6
- *
7
- * Licensed under the Apache License, Version 2.0 (the "License");
8
- * you may not use this file except in compliance with the License.
9
- * You may obtain a copy of the License at
10
- *
11
- * http://www.apache.org/licenses/LICENSE-2.0
12
- *
13
- * Unless required by applicable law or agreed to in writing, software
14
- * distributed under the License is distributed on an "AS IS" BASIS,
15
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16
- * See the License for the specific language governing permissions and
17
- * limitations under the License.
5
+ * Copyright 2011-2014 Twitter, Inc.
6
+ * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
18
7
  * ======================================================================== */
19
8
 
20
9
 
21
- +function ($) { "use strict";
10
+ +function ($) {
11
+ 'use strict';
22
12
 
23
13
  // COLLAPSE PUBLIC CLASS DEFINITION
24
14
  // ================================
@@ -69,7 +59,7 @@
69
59
  var complete = function () {
70
60
  this.$element
71
61
  .removeClass('collapsing')
72
- .addClass('in')
62
+ .addClass('collapse in')
73
63
  [dimension]('auto')
74
64
  this.transitioning = 0
75
65
  this.$element.trigger('shown.bs.collapse')
@@ -137,6 +127,7 @@
137
127
  var data = $this.data('bs.collapse')
138
128
  var options = $.extend({}, Collapse.DEFAULTS, $this.data(), typeof option == 'object' && option)
139
129
 
130
+ if (!data && options.toggle && option == 'show') option = !option
140
131
  if (!data) $this.data('bs.collapse', (data = new Collapse(this, options)))
141
132
  if (typeof option == 'string') data[option]()
142
133
  })
@@ -1,24 +1,14 @@
1
1
  /* ========================================================================
2
- * Bootstrap: dropdown.js v3.0.3
2
+ * Bootstrap: dropdown.js v3.1.0
3
3
  * http://getbootstrap.com/javascript/#dropdowns
4
4
  * ========================================================================
5
- * Copyright 2013 Twitter, Inc.
6
- *
7
- * Licensed under the Apache License, Version 2.0 (the "License");
8
- * you may not use this file except in compliance with the License.
9
- * You may obtain a copy of the License at
10
- *
11
- * http://www.apache.org/licenses/LICENSE-2.0
12
- *
13
- * Unless required by applicable law or agreed to in writing, software
14
- * distributed under the License is distributed on an "AS IS" BASIS,
15
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16
- * See the License for the specific language governing permissions and
17
- * limitations under the License.
5
+ * Copyright 2011-2014 Twitter, Inc.
6
+ * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
18
7
  * ======================================================================== */
19
8
 
20
9
 
21
- +function ($) { "use strict";
10
+ +function ($) {
11
+ 'use strict';
22
12
 
23
13
  // DROPDOWN CLASS DEFINITION
24
14
  // =========================
@@ -45,13 +35,14 @@
45
35
  $('<div class="dropdown-backdrop"/>').insertAfter($(this)).on('click', clearMenus)
46
36
  }
47
37
 
48
- $parent.trigger(e = $.Event('show.bs.dropdown'))
38
+ var relatedTarget = { relatedTarget: this }
39
+ $parent.trigger(e = $.Event('show.bs.dropdown', relatedTarget))
49
40
 
50
41
  if (e.isDefaultPrevented()) return
51
42
 
52
43
  $parent
53
44
  .toggleClass('open')
54
- .trigger('shown.bs.dropdown')
45
+ .trigger('shown.bs.dropdown', relatedTarget)
55
46
 
56
47
  $this.focus()
57
48
  }
@@ -77,7 +68,8 @@
77
68
  return $this.click()
78
69
  }
79
70
 
80
- var $items = $('[role=menu] li:not(.divider):visible a', $parent)
71
+ var desc = ' li:not(.divider):visible a'
72
+ var $items = $parent.find('[role=menu]' + desc + ', [role=listbox]' + desc)
81
73
 
82
74
  if (!$items.length) return
83
75
 
@@ -85,19 +77,20 @@
85
77
 
86
78
  if (e.keyCode == 38 && index > 0) index-- // up
87
79
  if (e.keyCode == 40 && index < $items.length - 1) index++ // down
88
- if (!~index) index=0
80
+ if (!~index) index = 0
89
81
 
90
82
  $items.eq(index).focus()
91
83
  }
92
84
 
93
- function clearMenus() {
85
+ function clearMenus(e) {
94
86
  $(backdrop).remove()
95
- $(toggle).each(function (e) {
87
+ $(toggle).each(function () {
96
88
  var $parent = getParent($(this))
89
+ var relatedTarget = { relatedTarget: this }
97
90
  if (!$parent.hasClass('open')) return
98
- $parent.trigger(e = $.Event('hide.bs.dropdown'))
91
+ $parent.trigger(e = $.Event('hide.bs.dropdown', relatedTarget))
99
92
  if (e.isDefaultPrevented()) return
100
- $parent.removeClass('open').trigger('hidden.bs.dropdown')
93
+ $parent.removeClass('open').trigger('hidden.bs.dropdown', relatedTarget)
101
94
  })
102
95
  }
103
96
 
@@ -106,7 +99,7 @@
106
99
 
107
100
  if (!selector) {
108
101
  selector = $this.attr('href')
109
- selector = selector && /#/.test(selector) && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7
102
+ selector = selector && /#[A-Za-z]/.test(selector) && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7
110
103
  }
111
104
 
112
105
  var $parent = selector && $(selector)
@@ -148,7 +141,7 @@
148
141
  $(document)
149
142
  .on('click.bs.dropdown.data-api', clearMenus)
150
143
  .on('click.bs.dropdown.data-api', '.dropdown form', function (e) { e.stopPropagation() })
151
- .on('click.bs.dropdown.data-api' , toggle, Dropdown.prototype.toggle)
152
- .on('keydown.bs.dropdown.data-api', toggle + ', [role=menu]' , Dropdown.prototype.keydown)
144
+ .on('click.bs.dropdown.data-api', toggle, Dropdown.prototype.toggle)
145
+ .on('keydown.bs.dropdown.data-api', toggle + ', [role=menu], [role=listbox]', Dropdown.prototype.keydown)
153
146
 
154
147
  }(jQuery);