bootstrap-generators 3.1.1.3 → 3.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (142) hide show
  1. checksums.yaml +4 -4
  2. data/.travis.yml +4 -5
  3. data/README.md +8 -8
  4. data/Rakefile +7 -5
  5. data/lib/bootstrap/generators/version.rb +1 -1
  6. data/lib/generators/bootstrap/install/templates/assets/stylesheets/bootstrap-variables.less +40 -23
  7. data/lib/generators/bootstrap/install/templates/assets/stylesheets/bootstrap-variables.scss +41 -24
  8. data/vendor/assets/javascripts/bootstrap.js +6 -6
  9. data/vendor/assets/javascripts/bootstrap/affix.js +19 -14
  10. data/vendor/assets/javascripts/bootstrap/alert.js +10 -6
  11. data/vendor/assets/javascripts/bootstrap/button.js +11 -8
  12. data/vendor/assets/javascripts/bootstrap/carousel.js +49 -31
  13. data/vendor/assets/javascripts/bootstrap/collapse.js +22 -22
  14. data/vendor/assets/javascripts/bootstrap/dropdown.js +17 -13
  15. data/vendor/assets/javascripts/bootstrap/modal.js +66 -29
  16. data/vendor/assets/javascripts/bootstrap/popover.js +10 -7
  17. data/vendor/assets/javascripts/bootstrap/scrollspy.js +40 -23
  18. data/vendor/assets/javascripts/bootstrap/tab.js +11 -8
  19. data/vendor/assets/javascripts/bootstrap/tooltip.js +115 -57
  20. data/vendor/assets/javascripts/bootstrap/transition.js +18 -7
  21. data/vendor/assets/stylesheets/bootstrap.css.erb +2740 -2322
  22. data/vendor/twitter/bootstrap/less/alerts.less +4 -3
  23. data/vendor/twitter/bootstrap/less/badges.less +18 -18
  24. data/vendor/twitter/bootstrap/less/bootstrap.less +3 -2
  25. data/vendor/twitter/bootstrap/less/button-groups.less +16 -2
  26. data/vendor/twitter/bootstrap/less/buttons.less +0 -2
  27. data/vendor/twitter/bootstrap/less/carousel.less +15 -4
  28. data/vendor/twitter/bootstrap/less/code.less +6 -1
  29. data/vendor/twitter/bootstrap/less/component-animations.less +6 -4
  30. data/vendor/twitter/bootstrap/less/dropdowns.less +2 -0
  31. data/vendor/twitter/bootstrap/less/forms.less +144 -42
  32. data/vendor/twitter/bootstrap/less/glyphicons.less +5 -5
  33. data/vendor/twitter/bootstrap/less/input-groups.less +6 -2
  34. data/vendor/twitter/bootstrap/less/jumbotron.less +4 -0
  35. data/vendor/twitter/bootstrap/less/labels.less +1 -1
  36. data/vendor/twitter/bootstrap/less/list-group.less +22 -1
  37. data/vendor/twitter/bootstrap/less/mixins.less +35 -925
  38. data/vendor/twitter/bootstrap/less/mixins/alerts.less +14 -0
  39. data/vendor/twitter/bootstrap/less/mixins/background-variant.less +8 -0
  40. data/vendor/twitter/bootstrap/less/mixins/border-radius.less +18 -0
  41. data/vendor/twitter/bootstrap/less/mixins/buttons.less +50 -0
  42. data/vendor/twitter/bootstrap/less/mixins/center-block.less +7 -0
  43. data/vendor/twitter/bootstrap/less/mixins/clearfix.less +22 -0
  44. data/vendor/twitter/bootstrap/less/mixins/forms.less +81 -0
  45. data/vendor/twitter/bootstrap/less/mixins/gradients.less +59 -0
  46. data/vendor/twitter/bootstrap/less/mixins/grid-framework.less +91 -0
  47. data/vendor/twitter/bootstrap/less/mixins/grid.less +122 -0
  48. data/vendor/twitter/bootstrap/less/mixins/hide-text.less +21 -0
  49. data/vendor/twitter/bootstrap/less/mixins/image.less +34 -0
  50. data/vendor/twitter/bootstrap/less/mixins/labels.less +12 -0
  51. data/vendor/twitter/bootstrap/less/mixins/list-group.less +29 -0
  52. data/vendor/twitter/bootstrap/less/mixins/nav-divider.less +10 -0
  53. data/vendor/twitter/bootstrap/less/mixins/nav-vertical-align.less +9 -0
  54. data/vendor/twitter/bootstrap/less/mixins/opacity.less +8 -0
  55. data/vendor/twitter/bootstrap/less/mixins/pagination.less +23 -0
  56. data/vendor/twitter/bootstrap/less/mixins/panels.less +24 -0
  57. data/vendor/twitter/bootstrap/less/mixins/progress-bar.less +10 -0
  58. data/vendor/twitter/bootstrap/less/mixins/reset-filter.less +8 -0
  59. data/vendor/twitter/bootstrap/less/mixins/resize.less +6 -0
  60. data/vendor/twitter/bootstrap/less/mixins/responsive-visibility.less +15 -0
  61. data/vendor/twitter/bootstrap/less/mixins/size.less +10 -0
  62. data/vendor/twitter/bootstrap/less/mixins/tab-focus.less +9 -0
  63. data/vendor/twitter/bootstrap/less/mixins/table-row.less +28 -0
  64. data/vendor/twitter/bootstrap/less/mixins/text-emphasis.less +8 -0
  65. data/vendor/twitter/bootstrap/less/mixins/text-overflow.less +8 -0
  66. data/vendor/twitter/bootstrap/less/mixins/vendor-prefixes.less +224 -0
  67. data/vendor/twitter/bootstrap/less/modals.less +18 -7
  68. data/vendor/twitter/bootstrap/less/navbar.less +41 -2
  69. data/vendor/twitter/bootstrap/less/navs.less +1 -1
  70. data/vendor/twitter/bootstrap/less/normalize.less +20 -18
  71. data/vendor/twitter/bootstrap/less/panels.less +8 -6
  72. data/vendor/twitter/bootstrap/less/popovers.less +1 -1
  73. data/vendor/twitter/bootstrap/less/progress-bars.less +27 -2
  74. data/vendor/twitter/bootstrap/less/responsive-embed.less +34 -0
  75. data/vendor/twitter/bootstrap/less/responsive-utilities.less +103 -1
  76. data/vendor/twitter/bootstrap/less/scaffolding.less +17 -1
  77. data/vendor/twitter/bootstrap/less/tables.less +4 -4
  78. data/vendor/twitter/bootstrap/less/theme.less +11 -0
  79. data/vendor/twitter/bootstrap/less/type.less +32 -12
  80. data/vendor/twitter/bootstrap/less/utilities.less +1 -0
  81. data/vendor/twitter/bootstrap/less/variables.less +40 -23
  82. data/vendor/twitter/bootstrap/sass/_alerts.scss +4 -3
  83. data/vendor/twitter/bootstrap/sass/_badges.scss +13 -11
  84. data/vendor/twitter/bootstrap/sass/_button-groups.scss +16 -2
  85. data/vendor/twitter/bootstrap/sass/_buttons.scss +0 -2
  86. data/vendor/twitter/bootstrap/sass/_carousel.scss +15 -4
  87. data/vendor/twitter/bootstrap/sass/_code.scss +6 -1
  88. data/vendor/twitter/bootstrap/sass/_component-animations.scss +10 -4
  89. data/vendor/twitter/bootstrap/sass/_dropdowns.scss +2 -0
  90. data/vendor/twitter/bootstrap/sass/_forms.scss +144 -42
  91. data/vendor/twitter/bootstrap/sass/_glyphicons.scss +4 -0
  92. data/vendor/twitter/bootstrap/sass/_input-groups.scss +6 -2
  93. data/vendor/twitter/bootstrap/sass/_jumbotron.scss +4 -0
  94. data/vendor/twitter/bootstrap/sass/_labels.scss +11 -9
  95. data/vendor/twitter/bootstrap/sass/_list-group.scss +22 -1
  96. data/vendor/twitter/bootstrap/sass/_mixins.scss +35 -943
  97. data/vendor/twitter/bootstrap/sass/_modals.scss +18 -7
  98. data/vendor/twitter/bootstrap/sass/_navbar.scss +41 -2
  99. data/vendor/twitter/bootstrap/sass/_navs.scss +1 -1
  100. data/vendor/twitter/bootstrap/sass/_normalize.scss +20 -18
  101. data/vendor/twitter/bootstrap/sass/_panels.scss +8 -6
  102. data/vendor/twitter/bootstrap/sass/_popovers.scss +1 -1
  103. data/vendor/twitter/bootstrap/sass/_progress-bars.scss +27 -2
  104. data/vendor/twitter/bootstrap/sass/_responsive-embed.scss +34 -0
  105. data/vendor/twitter/bootstrap/sass/_responsive-utilities.scss +101 -1
  106. data/vendor/twitter/bootstrap/sass/_scaffolding.scss +17 -1
  107. data/vendor/twitter/bootstrap/sass/_tables.scss +4 -4
  108. data/vendor/twitter/bootstrap/sass/_theme.scss +11 -0
  109. data/vendor/twitter/bootstrap/sass/_type.scss +32 -12
  110. data/vendor/twitter/bootstrap/sass/_utilities.scss +1 -0
  111. data/vendor/twitter/bootstrap/sass/_variables.scss +41 -24
  112. data/vendor/twitter/bootstrap/sass/bootstrap.scss +3 -2
  113. data/vendor/twitter/bootstrap/sass/mixins/_alerts.scss +14 -0
  114. data/vendor/twitter/bootstrap/sass/mixins/_background-variant.scss +11 -0
  115. data/vendor/twitter/bootstrap/sass/mixins/_border-radius.scss +18 -0
  116. data/vendor/twitter/bootstrap/sass/mixins/_buttons.scss +50 -0
  117. data/vendor/twitter/bootstrap/sass/mixins/_center-block.scss +7 -0
  118. data/vendor/twitter/bootstrap/sass/mixins/_clearfix.scss +22 -0
  119. data/vendor/twitter/bootstrap/sass/mixins/_forms.scss +84 -0
  120. data/vendor/twitter/bootstrap/sass/mixins/_gradients.scss +58 -0
  121. data/vendor/twitter/bootstrap/sass/mixins/_grid-framework.scss +81 -0
  122. data/vendor/twitter/bootstrap/sass/mixins/_grid.scss +122 -0
  123. data/vendor/twitter/bootstrap/sass/mixins/_hide-text.scss +21 -0
  124. data/vendor/twitter/bootstrap/sass/mixins/_image.scss +34 -0
  125. data/vendor/twitter/bootstrap/sass/mixins/_labels.scss +12 -0
  126. data/vendor/twitter/bootstrap/sass/mixins/_list-group.scss +31 -0
  127. data/vendor/twitter/bootstrap/sass/mixins/_nav-divider.scss +10 -0
  128. data/vendor/twitter/bootstrap/sass/mixins/_nav-vertical-align.scss +9 -0
  129. data/vendor/twitter/bootstrap/sass/mixins/_opacity.scss +8 -0
  130. data/vendor/twitter/bootstrap/sass/mixins/_pagination.scss +23 -0
  131. data/vendor/twitter/bootstrap/sass/mixins/_panels.scss +24 -0
  132. data/vendor/twitter/bootstrap/sass/mixins/_progress-bar.scss +10 -0
  133. data/vendor/twitter/bootstrap/sass/mixins/_reset-filter.scss +8 -0
  134. data/vendor/twitter/bootstrap/sass/mixins/_resize.scss +6 -0
  135. data/vendor/twitter/bootstrap/sass/mixins/_responsive-visibility.scss +21 -0
  136. data/vendor/twitter/bootstrap/sass/mixins/_size.scss +10 -0
  137. data/vendor/twitter/bootstrap/sass/mixins/_tab-focus.scss +9 -0
  138. data/vendor/twitter/bootstrap/sass/mixins/_table-row.scss +28 -0
  139. data/vendor/twitter/bootstrap/sass/mixins/_text-emphasis.scss +11 -0
  140. data/vendor/twitter/bootstrap/sass/mixins/_text-overflow.scss +8 -0
  141. data/vendor/twitter/bootstrap/sass/mixins/_vendor-prefixes.scss +219 -0
  142. metadata +62 -2
@@ -1,5 +1,5 @@
1
1
  /* ========================================================================
2
- * Bootstrap: dropdown.js v3.1.1
2
+ * Bootstrap: dropdown.js v3.2.0
3
3
  * http://getbootstrap.com/javascript/#dropdowns
4
4
  * ========================================================================
5
5
  * Copyright 2011-2014 Twitter, Inc.
@@ -14,11 +14,13 @@
14
14
  // =========================
15
15
 
16
16
  var backdrop = '.dropdown-backdrop'
17
- var toggle = '[data-toggle=dropdown]'
17
+ var toggle = '[data-toggle="dropdown"]'
18
18
  var Dropdown = function (element) {
19
19
  $(element).on('click.bs.dropdown', this.toggle)
20
20
  }
21
21
 
22
+ Dropdown.VERSION = '3.2.0'
23
+
22
24
  Dropdown.prototype.toggle = function (e) {
23
25
  var $this = $(this)
24
26
 
@@ -40,11 +42,11 @@
40
42
 
41
43
  if (e.isDefaultPrevented()) return
42
44
 
45
+ $this.trigger('focus')
46
+
43
47
  $parent
44
48
  .toggleClass('open')
45
49
  .trigger('shown.bs.dropdown', relatedTarget)
46
-
47
- $this.focus()
48
50
  }
49
51
 
50
52
  return false
@@ -64,12 +66,12 @@
64
66
  var isActive = $parent.hasClass('open')
65
67
 
66
68
  if (!isActive || (isActive && e.keyCode == 27)) {
67
- if (e.which == 27) $parent.find(toggle).focus()
68
- return $this.click()
69
+ if (e.which == 27) $parent.find(toggle).trigger('focus')
70
+ return $this.trigger('click')
69
71
  }
70
72
 
71
73
  var desc = ' li:not(.divider):visible a'
72
- var $items = $parent.find('[role=menu]' + desc + ', [role=listbox]' + desc)
74
+ var $items = $parent.find('[role="menu"]' + desc + ', [role="listbox"]' + desc)
73
75
 
74
76
  if (!$items.length) return
75
77
 
@@ -79,10 +81,11 @@
79
81
  if (e.keyCode == 40 && index < $items.length - 1) index++ // down
80
82
  if (!~index) index = 0
81
83
 
82
- $items.eq(index).focus()
84
+ $items.eq(index).trigger('focus')
83
85
  }
84
86
 
85
87
  function clearMenus(e) {
88
+ if (e && e.which === 3) return
86
89
  $(backdrop).remove()
87
90
  $(toggle).each(function () {
88
91
  var $parent = getParent($(this))
@@ -99,7 +102,7 @@
99
102
 
100
103
  if (!selector) {
101
104
  selector = $this.attr('href')
102
- selector = selector && /#[A-Za-z]/.test(selector) && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7
105
+ selector = selector && /#[A-Za-z]/.test(selector) && selector.replace(/.*(?=#[^\s]*$)/, '') // strip for ie7
103
106
  }
104
107
 
105
108
  var $parent = selector && $(selector)
@@ -111,9 +114,7 @@
111
114
  // DROPDOWN PLUGIN DEFINITION
112
115
  // ==========================
113
116
 
114
- var old = $.fn.dropdown
115
-
116
- $.fn.dropdown = function (option) {
117
+ function Plugin(option) {
117
118
  return this.each(function () {
118
119
  var $this = $(this)
119
120
  var data = $this.data('bs.dropdown')
@@ -123,6 +124,9 @@
123
124
  })
124
125
  }
125
126
 
127
+ var old = $.fn.dropdown
128
+
129
+ $.fn.dropdown = Plugin
126
130
  $.fn.dropdown.Constructor = Dropdown
127
131
 
128
132
 
@@ -142,6 +146,6 @@
142
146
  .on('click.bs.dropdown.data-api', clearMenus)
143
147
  .on('click.bs.dropdown.data-api', '.dropdown form', function (e) { e.stopPropagation() })
144
148
  .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)
149
+ .on('keydown.bs.dropdown.data-api', toggle + ', [role="menu"], [role="listbox"]', Dropdown.prototype.keydown)
146
150
 
147
151
  }(jQuery);
@@ -1,5 +1,5 @@
1
1
  /* ========================================================================
2
- * Bootstrap: modal.js v3.1.1
2
+ * Bootstrap: modal.js v3.2.0
3
3
  * http://getbootstrap.com/javascript/#modals
4
4
  * ========================================================================
5
5
  * Copyright 2011-2014 Twitter, Inc.
@@ -14,10 +14,12 @@
14
14
  // ======================
15
15
 
16
16
  var Modal = function (element, options) {
17
- this.options = options
18
- this.$element = $(element)
19
- this.$backdrop =
20
- this.isShown = null
17
+ this.options = options
18
+ this.$body = $(document.body)
19
+ this.$element = $(element)
20
+ this.$backdrop =
21
+ this.isShown = null
22
+ this.scrollbarWidth = 0
21
23
 
22
24
  if (this.options.remote) {
23
25
  this.$element
@@ -28,6 +30,8 @@
28
30
  }
29
31
  }
30
32
 
33
+ Modal.VERSION = '3.2.0'
34
+
31
35
  Modal.DEFAULTS = {
32
36
  backdrop: true,
33
37
  keyboard: true,
@@ -35,7 +39,7 @@
35
39
  }
36
40
 
37
41
  Modal.prototype.toggle = function (_relatedTarget) {
38
- return this[!this.isShown ? 'show' : 'hide'](_relatedTarget)
42
+ return this.isShown ? this.hide() : this.show(_relatedTarget)
39
43
  }
40
44
 
41
45
  Modal.prototype.show = function (_relatedTarget) {
@@ -48,6 +52,10 @@
48
52
 
49
53
  this.isShown = true
50
54
 
55
+ this.checkScrollbar()
56
+ this.$body.addClass('modal-open')
57
+
58
+ this.setScrollbar()
51
59
  this.escape()
52
60
 
53
61
  this.$element.on('click.dismiss.bs.modal', '[data-dismiss="modal"]', $.proxy(this.hide, this))
@@ -56,7 +64,7 @@
56
64
  var transition = $.support.transition && that.$element.hasClass('fade')
57
65
 
58
66
  if (!that.$element.parent().length) {
59
- that.$element.appendTo(document.body) // don't move modals dom position
67
+ that.$element.appendTo(that.$body) // don't move modals dom position
60
68
  }
61
69
 
62
70
  that.$element
@@ -77,11 +85,11 @@
77
85
 
78
86
  transition ?
79
87
  that.$element.find('.modal-dialog') // wait for modal to slide in
80
- .one($.support.transition.end, function () {
81
- that.$element.focus().trigger(e)
88
+ .one('bsTransitionEnd', function () {
89
+ that.$element.trigger('focus').trigger(e)
82
90
  })
83
91
  .emulateTransitionEnd(300) :
84
- that.$element.focus().trigger(e)
92
+ that.$element.trigger('focus').trigger(e)
85
93
  })
86
94
  }
87
95
 
@@ -96,6 +104,9 @@
96
104
 
97
105
  this.isShown = false
98
106
 
107
+ this.$body.removeClass('modal-open')
108
+
109
+ this.resetScrollbar()
99
110
  this.escape()
100
111
 
101
112
  $(document).off('focusin.bs.modal')
@@ -107,7 +118,7 @@
107
118
 
108
119
  $.support.transition && this.$element.hasClass('fade') ?
109
120
  this.$element
110
- .one($.support.transition.end, $.proxy(this.hideModal, this))
121
+ .one('bsTransitionEnd', $.proxy(this.hideModal, this))
111
122
  .emulateTransitionEnd(300) :
112
123
  this.hideModal()
113
124
  }
@@ -117,7 +128,7 @@
117
128
  .off('focusin.bs.modal') // guard against infinite focus loop
118
129
  .on('focusin.bs.modal', $.proxy(function (e) {
119
130
  if (this.$element[0] !== e.target && !this.$element.has(e.target).length) {
120
- this.$element.focus()
131
+ this.$element.trigger('focus')
121
132
  }
122
133
  }, this))
123
134
  }
@@ -136,7 +147,6 @@
136
147
  var that = this
137
148
  this.$element.hide()
138
149
  this.backdrop(function () {
139
- that.removeBackdrop()
140
150
  that.$element.trigger('hidden.bs.modal')
141
151
  })
142
152
  }
@@ -147,13 +157,14 @@
147
157
  }
148
158
 
149
159
  Modal.prototype.backdrop = function (callback) {
160
+ var that = this
150
161
  var animate = this.$element.hasClass('fade') ? 'fade' : ''
151
162
 
152
163
  if (this.isShown && this.options.backdrop) {
153
164
  var doAnimate = $.support.transition && animate
154
165
 
155
166
  this.$backdrop = $('<div class="modal-backdrop ' + animate + '" />')
156
- .appendTo(document.body)
167
+ .appendTo(this.$body)
157
168
 
158
169
  this.$element.on('click.dismiss.bs.modal', $.proxy(function (e) {
159
170
  if (e.target !== e.currentTarget) return
@@ -170,31 +181,56 @@
170
181
 
171
182
  doAnimate ?
172
183
  this.$backdrop
173
- .one($.support.transition.end, callback)
184
+ .one('bsTransitionEnd', callback)
174
185
  .emulateTransitionEnd(150) :
175
186
  callback()
176
187
 
177
188
  } else if (!this.isShown && this.$backdrop) {
178
189
  this.$backdrop.removeClass('in')
179
190
 
191
+ var callbackRemove = function () {
192
+ that.removeBackdrop()
193
+ callback && callback()
194
+ }
180
195
  $.support.transition && this.$element.hasClass('fade') ?
181
196
  this.$backdrop
182
- .one($.support.transition.end, callback)
197
+ .one('bsTransitionEnd', callbackRemove)
183
198
  .emulateTransitionEnd(150) :
184
- callback()
199
+ callbackRemove()
185
200
 
186
201
  } else if (callback) {
187
202
  callback()
188
203
  }
189
204
  }
190
205
 
206
+ Modal.prototype.checkScrollbar = function () {
207
+ if (document.body.clientWidth >= window.innerWidth) return
208
+ this.scrollbarWidth = this.scrollbarWidth || this.measureScrollbar()
209
+ }
210
+
211
+ Modal.prototype.setScrollbar = function () {
212
+ var bodyPad = parseInt((this.$body.css('padding-right') || 0), 10)
213
+ if (this.scrollbarWidth) this.$body.css('padding-right', bodyPad + this.scrollbarWidth)
214
+ }
215
+
216
+ Modal.prototype.resetScrollbar = function () {
217
+ this.$body.css('padding-right', '')
218
+ }
219
+
220
+ Modal.prototype.measureScrollbar = function () { // thx walsh
221
+ var scrollDiv = document.createElement('div')
222
+ scrollDiv.className = 'modal-scrollbar-measure'
223
+ this.$body.append(scrollDiv)
224
+ var scrollbarWidth = scrollDiv.offsetWidth - scrollDiv.clientWidth
225
+ this.$body[0].removeChild(scrollDiv)
226
+ return scrollbarWidth
227
+ }
228
+
191
229
 
192
230
  // MODAL PLUGIN DEFINITION
193
231
  // =======================
194
232
 
195
- var old = $.fn.modal
196
-
197
- $.fn.modal = function (option, _relatedTarget) {
233
+ function Plugin(option, _relatedTarget) {
198
234
  return this.each(function () {
199
235
  var $this = $(this)
200
236
  var data = $this.data('bs.modal')
@@ -206,6 +242,9 @@
206
242
  })
207
243
  }
208
244
 
245
+ var old = $.fn.modal
246
+
247
+ $.fn.modal = Plugin
209
248
  $.fn.modal.Constructor = Modal
210
249
 
211
250
 
@@ -224,20 +263,18 @@
224
263
  $(document).on('click.bs.modal.data-api', '[data-toggle="modal"]', function (e) {
225
264
  var $this = $(this)
226
265
  var href = $this.attr('href')
227
- var $target = $($this.attr('data-target') || (href && href.replace(/.*(?=#[^\s]+$)/, ''))) //strip for ie7
266
+ var $target = $($this.attr('data-target') || (href && href.replace(/.*(?=#[^\s]+$)/, ''))) // strip for ie7
228
267
  var option = $target.data('bs.modal') ? 'toggle' : $.extend({ remote: !/#/.test(href) && href }, $target.data(), $this.data())
229
268
 
230
269
  if ($this.is('a')) e.preventDefault()
231
270
 
232
- $target
233
- .modal(option, this)
234
- .one('hide', function () {
235
- $this.is(':visible') && $this.focus()
271
+ $target.one('show.bs.modal', function (showEvent) {
272
+ if (showEvent.isDefaultPrevented()) return // only register focus restorer if modal will actually get shown
273
+ $target.one('hidden.bs.modal', function () {
274
+ $this.is(':visible') && $this.trigger('focus')
236
275
  })
276
+ })
277
+ Plugin.call($target, option, this)
237
278
  })
238
279
 
239
- $(document)
240
- .on('show.bs.modal', '.modal', function () { $(document.body).addClass('modal-open') })
241
- .on('hidden.bs.modal', '.modal', function () { $(document.body).removeClass('modal-open') })
242
-
243
280
  }(jQuery);
@@ -1,5 +1,5 @@
1
1
  /* ========================================================================
2
- * Bootstrap: popover.js v3.1.1
2
+ * Bootstrap: popover.js v3.2.0
3
3
  * http://getbootstrap.com/javascript/#popovers
4
4
  * ========================================================================
5
5
  * Copyright 2011-2014 Twitter, Inc.
@@ -19,11 +19,13 @@
19
19
 
20
20
  if (!$.fn.tooltip) throw new Error('Popover requires tooltip.js')
21
21
 
22
+ Popover.VERSION = '3.2.0'
23
+
22
24
  Popover.DEFAULTS = $.extend({}, $.fn.tooltip.Constructor.DEFAULTS, {
23
25
  placement: 'right',
24
26
  trigger: 'click',
25
27
  content: '',
26
- template: '<div class="popover"><div class="arrow"></div><h3 class="popover-title"></h3><div class="popover-content"></div></div>'
28
+ template: '<div class="popover" role="tooltip"><div class="arrow"></div><h3 class="popover-title"></h3><div class="popover-content"></div></div>'
27
29
  })
28
30
 
29
31
 
@@ -44,7 +46,7 @@
44
46
  var content = this.getContent()
45
47
 
46
48
  $tip.find('.popover-title')[this.options.html ? 'html' : 'text'](title)
47
- $tip.find('.popover-content')[ // we use append for html objects to maintain js events
49
+ $tip.find('.popover-content').empty()[ // we use append for html objects to maintain js events
48
50
  this.options.html ? (typeof content == 'string' ? 'html' : 'append') : 'text'
49
51
  ](content)
50
52
 
@@ -70,7 +72,7 @@
70
72
  }
71
73
 
72
74
  Popover.prototype.arrow = function () {
73
- return this.$arrow = this.$arrow || this.tip().find('.arrow')
75
+ return (this.$arrow = this.$arrow || this.tip().find('.arrow'))
74
76
  }
75
77
 
76
78
  Popover.prototype.tip = function () {
@@ -82,9 +84,7 @@
82
84
  // POPOVER PLUGIN DEFINITION
83
85
  // =========================
84
86
 
85
- var old = $.fn.popover
86
-
87
- $.fn.popover = function (option) {
87
+ function Plugin(option) {
88
88
  return this.each(function () {
89
89
  var $this = $(this)
90
90
  var data = $this.data('bs.popover')
@@ -96,6 +96,9 @@
96
96
  })
97
97
  }
98
98
 
99
+ var old = $.fn.popover
100
+
101
+ $.fn.popover = Plugin
99
102
  $.fn.popover.Constructor = Popover
100
103
 
101
104
 
@@ -1,5 +1,5 @@
1
1
  /* ========================================================================
2
- * Bootstrap: scrollspy.js v3.1.1
2
+ * Bootstrap: scrollspy.js v3.2.0
3
3
  * http://getbootstrap.com/javascript/#scrollspy
4
4
  * ========================================================================
5
5
  * Copyright 2011-2014 Twitter, Inc.
@@ -14,36 +14,48 @@
14
14
  // ==========================
15
15
 
16
16
  function ScrollSpy(element, options) {
17
- var href
18
17
  var process = $.proxy(this.process, this)
19
18
 
20
- this.$element = $(element).is('body') ? $(window) : $(element)
21
19
  this.$body = $('body')
22
- this.$scrollElement = this.$element.on('scroll.bs.scroll-spy.data-api', process)
20
+ this.$scrollElement = $(element).is('body') ? $(window) : $(element)
23
21
  this.options = $.extend({}, ScrollSpy.DEFAULTS, options)
24
- this.selector = (this.options.target
25
- || ((href = $(element).attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '')) //strip for ie7
26
- || '') + ' .nav li > a'
27
- this.offsets = $([])
28
- this.targets = $([])
22
+ this.selector = (this.options.target || '') + ' .nav li > a'
23
+ this.offsets = []
24
+ this.targets = []
29
25
  this.activeTarget = null
26
+ this.scrollHeight = 0
30
27
 
28
+ this.$scrollElement.on('scroll.bs.scrollspy', process)
31
29
  this.refresh()
32
30
  this.process()
33
31
  }
34
32
 
33
+ ScrollSpy.VERSION = '3.2.0'
34
+
35
35
  ScrollSpy.DEFAULTS = {
36
36
  offset: 10
37
37
  }
38
38
 
39
+ ScrollSpy.prototype.getScrollHeight = function () {
40
+ return this.$scrollElement[0].scrollHeight || Math.max(this.$body[0].scrollHeight, document.documentElement.scrollHeight)
41
+ }
42
+
39
43
  ScrollSpy.prototype.refresh = function () {
40
- var offsetMethod = this.$element[0] == window ? 'offset' : 'position'
44
+ var offsetMethod = 'offset'
45
+ var offsetBase = 0
41
46
 
42
- this.offsets = $([])
43
- this.targets = $([])
47
+ if (!$.isWindow(this.$scrollElement[0])) {
48
+ offsetMethod = 'position'
49
+ offsetBase = this.$scrollElement.scrollTop()
50
+ }
51
+
52
+ this.offsets = []
53
+ this.targets = []
54
+ this.scrollHeight = this.getScrollHeight()
44
55
 
45
56
  var self = this
46
- var $targets = this.$body
57
+
58
+ this.$body
47
59
  .find(this.selector)
48
60
  .map(function () {
49
61
  var $el = $(this)
@@ -53,7 +65,7 @@
53
65
  return ($href
54
66
  && $href.length
55
67
  && $href.is(':visible')
56
- && [[ $href[offsetMethod]().top + (!$.isWindow(self.$scrollElement.get(0)) && self.$scrollElement.scrollTop()), href ]]) || null
68
+ && [[$href[offsetMethod]().top + offsetBase, href]]) || null
57
69
  })
58
70
  .sort(function (a, b) { return a[0] - b[0] })
59
71
  .each(function () {
@@ -64,15 +76,19 @@
64
76
 
65
77
  ScrollSpy.prototype.process = function () {
66
78
  var scrollTop = this.$scrollElement.scrollTop() + this.options.offset
67
- var scrollHeight = this.$scrollElement[0].scrollHeight || this.$body[0].scrollHeight
68
- var maxScroll = scrollHeight - this.$scrollElement.height()
79
+ var scrollHeight = this.getScrollHeight()
80
+ var maxScroll = this.options.offset + scrollHeight - this.$scrollElement.height()
69
81
  var offsets = this.offsets
70
82
  var targets = this.targets
71
83
  var activeTarget = this.activeTarget
72
84
  var i
73
85
 
86
+ if (this.scrollHeight != scrollHeight) {
87
+ this.refresh()
88
+ }
89
+
74
90
  if (scrollTop >= maxScroll) {
75
- return activeTarget != (i = targets.last()[0]) && this.activate(i)
91
+ return activeTarget != (i = targets[targets.length - 1]) && this.activate(i)
76
92
  }
77
93
 
78
94
  if (activeTarget && scrollTop <= offsets[0]) {
@@ -83,7 +99,7 @@
83
99
  activeTarget != targets[i]
84
100
  && scrollTop >= offsets[i]
85
101
  && (!offsets[i + 1] || scrollTop <= offsets[i + 1])
86
- && this.activate( targets[i] )
102
+ && this.activate(targets[i])
87
103
  }
88
104
  }
89
105
 
@@ -115,9 +131,7 @@
115
131
  // SCROLLSPY PLUGIN DEFINITION
116
132
  // ===========================
117
133
 
118
- var old = $.fn.scrollspy
119
-
120
- $.fn.scrollspy = function (option) {
134
+ function Plugin(option) {
121
135
  return this.each(function () {
122
136
  var $this = $(this)
123
137
  var data = $this.data('bs.scrollspy')
@@ -128,6 +142,9 @@
128
142
  })
129
143
  }
130
144
 
145
+ var old = $.fn.scrollspy
146
+
147
+ $.fn.scrollspy = Plugin
131
148
  $.fn.scrollspy.Constructor = ScrollSpy
132
149
 
133
150
 
@@ -143,10 +160,10 @@
143
160
  // SCROLLSPY DATA-API
144
161
  // ==================
145
162
 
146
- $(window).on('load', function () {
163
+ $(window).on('load.bs.scrollspy.data-api', function () {
147
164
  $('[data-spy="scroll"]').each(function () {
148
165
  var $spy = $(this)
149
- $spy.scrollspy($spy.data())
166
+ Plugin.call($spy, $spy.data())
150
167
  })
151
168
  })
152
169