bootstrap-on-rails 3.2.0 → 3.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (90) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +5 -1
  3. data/app/assets/fonts/bootstrap/glyphicons-halflings-regular.eot +0 -0
  4. data/app/assets/fonts/bootstrap/glyphicons-halflings-regular.svg +1 -1
  5. data/app/assets/fonts/bootstrap/glyphicons-halflings-regular.ttf +0 -0
  6. data/app/assets/fonts/bootstrap/glyphicons-halflings-regular.woff +0 -0
  7. data/app/assets/javascripts/bootstrap/affix.js +43 -23
  8. data/app/assets/javascripts/bootstrap/alert.js +6 -4
  9. data/app/assets/javascripts/bootstrap/button.js +16 -10
  10. data/app/assets/javascripts/bootstrap/carousel.js +27 -10
  11. data/app/assets/javascripts/bootstrap/collapse.js +69 -28
  12. data/app/assets/javascripts/bootstrap/dropdown.js +20 -10
  13. data/app/assets/javascripts/bootstrap/modal.js +67 -23
  14. data/app/assets/javascripts/bootstrap/popover.js +13 -7
  15. data/app/assets/javascripts/bootstrap/scrollspy.js +12 -7
  16. data/app/assets/javascripts/bootstrap/tab.js +41 -16
  17. data/app/assets/javascripts/bootstrap/tooltip.js +60 -39
  18. data/app/assets/javascripts/bootstrap/transition.js +1 -1
  19. data/app/assets/stylesheets/bootstrap/alerts.less +0 -0
  20. data/app/assets/stylesheets/bootstrap/badges.less +7 -1
  21. data/app/assets/stylesheets/bootstrap/bootstrap.less +0 -0
  22. data/app/assets/stylesheets/bootstrap/breadcrumbs.less +0 -0
  23. data/app/assets/stylesheets/bootstrap/button-groups.less +16 -13
  24. data/app/assets/stylesheets/bootstrap/buttons.less +7 -4
  25. data/app/assets/stylesheets/bootstrap/carousel.less +24 -0
  26. data/app/assets/stylesheets/bootstrap/close.less +0 -0
  27. data/app/assets/stylesheets/bootstrap/code.less +1 -0
  28. data/app/assets/stylesheets/bootstrap/component-animations.less +5 -2
  29. data/app/assets/stylesheets/bootstrap/dropdowns.less +3 -5
  30. data/app/assets/stylesheets/bootstrap/forms.less +46 -40
  31. data/app/assets/stylesheets/bootstrap/glyphicons.less +7 -6
  32. data/app/assets/stylesheets/bootstrap/grid.less +0 -0
  33. data/app/assets/stylesheets/bootstrap/input-groups.less +0 -0
  34. data/app/assets/stylesheets/bootstrap/jumbotron.less +6 -5
  35. data/app/assets/stylesheets/bootstrap/labels.less +0 -0
  36. data/app/assets/stylesheets/bootstrap/list-group.less +1 -8
  37. data/app/assets/stylesheets/bootstrap/media.less +27 -36
  38. data/app/assets/stylesheets/bootstrap/mixins.less +0 -0
  39. data/app/assets/stylesheets/bootstrap/mixins/alerts.less +0 -0
  40. data/app/assets/stylesheets/bootstrap/mixins/background-variant.less +0 -0
  41. data/app/assets/stylesheets/bootstrap/mixins/border-radius.less +0 -0
  42. data/app/assets/stylesheets/bootstrap/mixins/buttons.less +2 -0
  43. data/app/assets/stylesheets/bootstrap/mixins/center-block.less +0 -0
  44. data/app/assets/stylesheets/bootstrap/mixins/clearfix.less +0 -0
  45. data/app/assets/stylesheets/bootstrap/mixins/forms.less +5 -1
  46. data/app/assets/stylesheets/bootstrap/mixins/gradients.less +0 -0
  47. data/app/assets/stylesheets/bootstrap/mixins/grid-framework.less +2 -2
  48. data/app/assets/stylesheets/bootstrap/mixins/grid.less +0 -0
  49. data/app/assets/stylesheets/bootstrap/mixins/hide-text.less +0 -0
  50. data/app/assets/stylesheets/bootstrap/mixins/image.less +0 -1
  51. data/app/assets/stylesheets/bootstrap/mixins/labels.less +1 -1
  52. data/app/assets/stylesheets/bootstrap/mixins/list-group.less +0 -0
  53. data/app/assets/stylesheets/bootstrap/mixins/nav-divider.less +0 -0
  54. data/app/assets/stylesheets/bootstrap/mixins/nav-vertical-align.less +0 -0
  55. data/app/assets/stylesheets/bootstrap/mixins/opacity.less +0 -0
  56. data/app/assets/stylesheets/bootstrap/mixins/pagination.less +0 -0
  57. data/app/assets/stylesheets/bootstrap/mixins/panels.less +0 -0
  58. data/app/assets/stylesheets/bootstrap/mixins/progress-bar.less +0 -0
  59. data/app/assets/stylesheets/bootstrap/mixins/reset-filter.less +0 -0
  60. data/app/assets/stylesheets/bootstrap/mixins/resize.less +0 -0
  61. data/app/assets/stylesheets/bootstrap/mixins/responsive-visibility.less +0 -0
  62. data/app/assets/stylesheets/bootstrap/mixins/size.less +0 -0
  63. data/app/assets/stylesheets/bootstrap/mixins/tab-focus.less +0 -0
  64. data/app/assets/stylesheets/bootstrap/mixins/table-row.less +0 -0
  65. data/app/assets/stylesheets/bootstrap/mixins/text-emphasis.less +0 -0
  66. data/app/assets/stylesheets/bootstrap/mixins/text-overflow.less +0 -0
  67. data/app/assets/stylesheets/bootstrap/mixins/vendor-prefixes.less +6 -3
  68. data/app/assets/stylesheets/bootstrap/modals.less +3 -5
  69. data/app/assets/stylesheets/bootstrap/navbar.less +30 -25
  70. data/app/assets/stylesheets/bootstrap/navs.less +3 -1
  71. data/app/assets/stylesheets/bootstrap/normalize.less +5 -3
  72. data/app/assets/stylesheets/bootstrap/pager.less +1 -2
  73. data/app/assets/stylesheets/bootstrap/pagination.less +1 -1
  74. data/app/assets/stylesheets/bootstrap/panels.less +21 -3
  75. data/app/assets/stylesheets/bootstrap/popovers.less +6 -4
  76. data/app/assets/stylesheets/bootstrap/print.less +102 -96
  77. data/app/assets/stylesheets/bootstrap/progress-bars.less +1 -19
  78. data/app/assets/stylesheets/bootstrap/responsive-embed.less +2 -1
  79. data/app/assets/stylesheets/bootstrap/responsive-utilities.less +0 -0
  80. data/app/assets/stylesheets/bootstrap/scaffolding.less +1 -1
  81. data/app/assets/stylesheets/bootstrap/tables.less +11 -10
  82. data/app/assets/stylesheets/bootstrap/theme.less +23 -9
  83. data/app/assets/stylesheets/bootstrap/thumbnails.less +1 -1
  84. data/app/assets/stylesheets/bootstrap/tooltip.less +12 -4
  85. data/app/assets/stylesheets/bootstrap/type.less +0 -11
  86. data/app/assets/stylesheets/bootstrap/utilities.less +0 -1
  87. data/app/assets/stylesheets/bootstrap/variables.less +31 -20
  88. data/app/assets/stylesheets/bootstrap/wells.less +0 -0
  89. data/lib/bootstrap-on-rails/version.rb +1 -1
  90. metadata +2 -2
@@ -1,5 +1,5 @@
1
1
  /* ========================================================================
2
- * Bootstrap: tooltip.js v3.2.0
2
+ * Bootstrap: tooltip.js v3.3.1
3
3
  * http://getbootstrap.com/javascript/#tooltip
4
4
  * Inspired by the original jQuery.tipsy by Jason Frame
5
5
  * ========================================================================
@@ -25,7 +25,9 @@
25
25
  this.init('tooltip', element, options)
26
26
  }
27
27
 
28
- Tooltip.VERSION = '3.2.0'
28
+ Tooltip.VERSION = '3.3.1'
29
+
30
+ Tooltip.TRANSITION_DURATION = 150
29
31
 
30
32
  Tooltip.DEFAULTS = {
31
33
  animation: true,
@@ -103,6 +105,11 @@
103
105
  var self = obj instanceof this.constructor ?
104
106
  obj : $(obj.currentTarget).data('bs.' + this.type)
105
107
 
108
+ if (self && self.$tip && self.$tip.is(':visible')) {
109
+ self.hoverState = 'in'
110
+ return
111
+ }
112
+
106
113
  if (!self) {
107
114
  self = new this.constructor(obj.currentTarget, this.getDelegateOptions())
108
115
  $(obj.currentTarget).data('bs.' + this.type, self)
@@ -145,7 +152,7 @@
145
152
  if (this.hasContent() && this.enabled) {
146
153
  this.$element.trigger(e)
147
154
 
148
- var inDom = $.contains(document.documentElement, this.$element[0])
155
+ var inDom = $.contains(this.$element[0].ownerDocument.documentElement, this.$element[0])
149
156
  if (e.isDefaultPrevented() || !inDom) return
150
157
  var that = this
151
158
 
@@ -181,13 +188,13 @@
181
188
 
182
189
  if (autoPlace) {
183
190
  var orgPlacement = placement
184
- var $parent = this.$element.parent()
185
- var parentDim = this.getPosition($parent)
191
+ var $container = this.options.container ? $(this.options.container) : this.$element.parent()
192
+ var containerDim = this.getPosition($container)
186
193
 
187
- placement = placement == 'bottom' && pos.top + pos.height + actualHeight - parentDim.scroll > parentDim.height ? 'top' :
188
- placement == 'top' && pos.top - parentDim.scroll - actualHeight < 0 ? 'bottom' :
189
- placement == 'right' && pos.right + actualWidth > parentDim.width ? 'left' :
190
- placement == 'left' && pos.left - actualWidth < parentDim.left ? 'right' :
194
+ placement = placement == 'bottom' && pos.bottom + actualHeight > containerDim.bottom ? 'top' :
195
+ placement == 'top' && pos.top - actualHeight < containerDim.top ? 'bottom' :
196
+ placement == 'right' && pos.right + actualWidth > containerDim.width ? 'left' :
197
+ placement == 'left' && pos.left - actualWidth < containerDim.left ? 'right' :
191
198
  placement
192
199
 
193
200
  $tip
@@ -200,14 +207,17 @@
200
207
  this.applyPlacement(calculatedOffset, placement)
201
208
 
202
209
  var complete = function () {
210
+ var prevHoverState = that.hoverState
203
211
  that.$element.trigger('shown.bs.' + that.type)
204
212
  that.hoverState = null
213
+
214
+ if (prevHoverState == 'out') that.leave(that)
205
215
  }
206
216
 
207
217
  $.support.transition && this.$tip.hasClass('fade') ?
208
218
  $tip
209
219
  .one('bsTransitionEnd', complete)
210
- .emulateTransitionEnd(150) :
220
+ .emulateTransitionEnd(Tooltip.TRANSITION_DURATION) :
211
221
  complete()
212
222
  }
213
223
  }
@@ -254,16 +264,18 @@
254
264
  if (delta.left) offset.left += delta.left
255
265
  else offset.top += delta.top
256
266
 
257
- var arrowDelta = delta.left ? delta.left * 2 - width + actualWidth : delta.top * 2 - height + actualHeight
258
- var arrowPosition = delta.left ? 'left' : 'top'
259
- var arrowOffsetPosition = delta.left ? 'offsetWidth' : 'offsetHeight'
267
+ var isVertical = /top|bottom/.test(placement)
268
+ var arrowDelta = isVertical ? delta.left * 2 - width + actualWidth : delta.top * 2 - height + actualHeight
269
+ var arrowOffsetPosition = isVertical ? 'offsetWidth' : 'offsetHeight'
260
270
 
261
271
  $tip.offset(offset)
262
- this.replaceArrow(arrowDelta, $tip[0][arrowOffsetPosition], arrowPosition)
272
+ this.replaceArrow(arrowDelta, $tip[0][arrowOffsetPosition], isVertical)
263
273
  }
264
274
 
265
- Tooltip.prototype.replaceArrow = function (delta, dimension, position) {
266
- this.arrow().css(position, delta ? (50 * (1 - delta / dimension) + '%') : '')
275
+ Tooltip.prototype.replaceArrow = function (delta, dimension, isHorizontal) {
276
+ this.arrow()
277
+ .css(isHorizontal ? 'left' : 'top', 50 * (1 - delta / dimension) + '%')
278
+ .css(isHorizontal ? 'top' : 'left', '')
267
279
  }
268
280
 
269
281
  Tooltip.prototype.setContent = function () {
@@ -274,16 +286,17 @@
274
286
  $tip.removeClass('fade in top bottom left right')
275
287
  }
276
288
 
277
- Tooltip.prototype.hide = function () {
289
+ Tooltip.prototype.hide = function (callback) {
278
290
  var that = this
279
291
  var $tip = this.tip()
280
292
  var e = $.Event('hide.bs.' + this.type)
281
293
 
282
- this.$element.removeAttr('aria-describedby')
283
-
284
294
  function complete() {
285
295
  if (that.hoverState != 'in') $tip.detach()
286
- that.$element.trigger('hidden.bs.' + that.type)
296
+ that.$element
297
+ .removeAttr('aria-describedby')
298
+ .trigger('hidden.bs.' + that.type)
299
+ callback && callback()
287
300
  }
288
301
 
289
302
  this.$element.trigger(e)
@@ -295,7 +308,7 @@
295
308
  $.support.transition && this.$tip.hasClass('fade') ?
296
309
  $tip
297
310
  .one('bsTransitionEnd', complete)
298
- .emulateTransitionEnd(150) :
311
+ .emulateTransitionEnd(Tooltip.TRANSITION_DURATION) :
299
312
  complete()
300
313
 
301
314
  this.hoverState = null
@@ -316,13 +329,20 @@
316
329
 
317
330
  Tooltip.prototype.getPosition = function ($element) {
318
331
  $element = $element || this.$element
332
+
319
333
  var el = $element[0]
320
334
  var isBody = el.tagName == 'BODY'
321
- return $.extend({}, (typeof el.getBoundingClientRect == 'function') ? el.getBoundingClientRect() : null, {
322
- scroll: isBody ? document.documentElement.scrollTop || document.body.scrollTop : $element.scrollTop(),
323
- width: isBody ? $(window).width() : $element.outerWidth(),
324
- height: isBody ? $(window).height() : $element.outerHeight()
325
- }, isBody ? { top: 0, left: 0 } : $element.offset())
335
+
336
+ var elRect = el.getBoundingClientRect()
337
+ if (elRect.width == null) {
338
+ // width and height are missing in IE8, so compute them manually; see https://github.com/twbs/bootstrap/issues/14093
339
+ elRect = $.extend({}, elRect, { width: elRect.right - elRect.left, height: elRect.bottom - elRect.top })
340
+ }
341
+ var elOffset = isBody ? { top: 0, left: 0 } : $element.offset()
342
+ var scroll = { scroll: isBody ? document.documentElement.scrollTop || document.body.scrollTop : $element.scrollTop() }
343
+ var outerDims = isBody ? { width: $(window).width(), height: $(window).height() } : null
344
+
345
+ return $.extend({}, elRect, scroll, outerDims, elOffset)
326
346
  }
327
347
 
328
348
  Tooltip.prototype.getCalculatedOffset = function (placement, pos, actualWidth, actualHeight) {
@@ -386,14 +406,6 @@
386
406
  return (this.$arrow = this.$arrow || this.tip().find('.tooltip-arrow'))
387
407
  }
388
408
 
389
- Tooltip.prototype.validate = function () {
390
- if (!this.$element[0].parentNode) {
391
- this.hide()
392
- this.$element = null
393
- this.options = null
394
- }
395
- }
396
-
397
409
  Tooltip.prototype.enable = function () {
398
410
  this.enabled = true
399
411
  }
@@ -420,8 +432,11 @@
420
432
  }
421
433
 
422
434
  Tooltip.prototype.destroy = function () {
435
+ var that = this
423
436
  clearTimeout(this.timeout)
424
- this.hide().$element.off('.' + this.type).removeData('bs.' + this.type)
437
+ this.hide(function () {
438
+ that.$element.off('.' + that.type).removeData('bs.' + that.type)
439
+ })
425
440
  }
426
441
 
427
442
 
@@ -430,12 +445,18 @@
430
445
 
431
446
  function Plugin(option) {
432
447
  return this.each(function () {
433
- var $this = $(this)
434
- var data = $this.data('bs.tooltip')
435
- var options = typeof option == 'object' && option
448
+ var $this = $(this)
449
+ var data = $this.data('bs.tooltip')
450
+ var options = typeof option == 'object' && option
451
+ var selector = options && options.selector
436
452
 
437
453
  if (!data && option == 'destroy') return
438
- if (!data) $this.data('bs.tooltip', (data = new Tooltip(this, options)))
454
+ if (selector) {
455
+ if (!data) $this.data('bs.tooltip', (data = {}))
456
+ if (!data[selector]) data[selector] = new Tooltip(this, options)
457
+ } else {
458
+ if (!data) $this.data('bs.tooltip', (data = new Tooltip(this, options)))
459
+ }
439
460
  if (typeof option == 'string') data[option]()
440
461
  })
441
462
  }
@@ -1,5 +1,5 @@
1
1
  /* ========================================================================
2
- * Bootstrap: transition.js v3.2.0
2
+ * Bootstrap: transition.js v3.3.1
3
3
  * http://getbootstrap.com/javascript/#transitions
4
4
  * ========================================================================
5
5
  * Copyright 2011-2014 Twitter, Inc.
@@ -44,11 +44,17 @@
44
44
  }
45
45
 
46
46
  // Account for badges in navs
47
- a.list-group-item.active > &,
47
+ .list-group-item.active > &,
48
48
  .nav-pills > .active > a > & {
49
49
  color: @badge-active-color;
50
50
  background-color: @badge-active-bg;
51
51
  }
52
+ .list-group-item > & {
53
+ float: right;
54
+ }
55
+ .list-group-item > & + & {
56
+ margin-right: 5px;
57
+ }
52
58
  .nav-pills > li > a > & {
53
59
  margin-left: 3px;
54
60
  }
@@ -18,10 +18,6 @@
18
18
  &.active {
19
19
  z-index: 2;
20
20
  }
21
- &:focus {
22
- // Remove focus outline when dropdown JS adds it after closing the menu
23
- outline: 0;
24
- }
25
21
  }
26
22
  }
27
23
 
@@ -198,7 +194,6 @@
198
194
  }
199
195
 
200
196
 
201
-
202
197
  // Justified button groups
203
198
  // ----------------------
204
199
 
@@ -226,15 +221,23 @@
226
221
  // Checkbox and radio options
227
222
  //
228
223
  // In order to support the browser's form validation feedback, powered by the
229
- // `required` attribute, we have to "hide" the inputs via `opacity`. We cannot
230
- // use `display: none;` or `visibility: hidden;` as that also hides the popover.
224
+ // `required` attribute, we have to "hide" the inputs via `clip`. We cannot use
225
+ // `display: none;` or `visibility: hidden;` as that also hides the popover.
226
+ // Simply visually hiding the inputs via `opacity` would leave them clickable in
227
+ // certain cases which is prevented by using `clip` and `pointer-events`.
231
228
  // This way, we ensure a DOM element is visible to position the popover from.
232
229
  //
233
- // See https://github.com/twbs/bootstrap/pull/12794 for more.
230
+ // See https://github.com/twbs/bootstrap/pull/12794 and
231
+ // https://github.com/twbs/bootstrap/pull/14559 for more information.
234
232
 
235
- [data-toggle="buttons"] > .btn > input[type="radio"],
236
- [data-toggle="buttons"] > .btn > input[type="checkbox"] {
237
- position: absolute;
238
- z-index: -1;
239
- .opacity(0);
233
+ [data-toggle="buttons"] {
234
+ > .btn,
235
+ > .btn-group > .btn {
236
+ input[type="radio"],
237
+ input[type="checkbox"] {
238
+ position: absolute;
239
+ clip: rect(0,0,0,0);
240
+ pointer-events: none;
241
+ }
242
+ }
240
243
  }
@@ -12,6 +12,7 @@
12
12
  font-weight: @btn-font-weight;
13
13
  text-align: center;
14
14
  vertical-align: middle;
15
+ touch-action: manipulation;
15
16
  cursor: pointer;
16
17
  background-image: none; // Reset unusual Firefox-on-Android default style; see https://github.com/necolas/normalize.css/issues/214
17
18
  border: 1px solid transparent;
@@ -22,13 +23,15 @@
22
23
  &,
23
24
  &:active,
24
25
  &.active {
25
- &:focus {
26
+ &:focus,
27
+ &.focus {
26
28
  .tab-focus();
27
29
  }
28
30
  }
29
31
 
30
32
  &:hover,
31
- &:focus {
33
+ &:focus,
34
+ &.focus {
32
35
  color: @btn-default-color;
33
36
  text-decoration: none;
34
37
  }
@@ -43,7 +46,7 @@
43
46
  &.disabled,
44
47
  &[disabled],
45
48
  fieldset[disabled] & {
46
- cursor: not-allowed;
49
+ cursor: @cursor-disabled;
47
50
  pointer-events: none; // Future-proof disabling of clicks
48
51
  .opacity(.65);
49
52
  .box-shadow(none);
@@ -85,11 +88,11 @@
85
88
  .btn-link {
86
89
  color: @link-color;
87
90
  font-weight: normal;
88
- cursor: pointer;
89
91
  border-radius: 0;
90
92
 
91
93
  &,
92
94
  &:active,
95
+ &.active,
93
96
  &[disabled],
94
97
  fieldset[disabled] & {
95
98
  background-color: transparent;
@@ -24,6 +24,30 @@
24
24
  &:extend(.img-responsive);
25
25
  line-height: 1;
26
26
  }
27
+
28
+ // WebKit CSS3 transforms for supported devices
29
+ @media all and (transform-3d), (-webkit-transform-3d) {
30
+ transition: transform .6s ease-in-out;
31
+ backface-visibility: hidden;
32
+ perspective: 1000;
33
+
34
+ &.next,
35
+ &.active.right {
36
+ transform: translate3d(100%, 0, 0);
37
+ left: 0;
38
+ }
39
+ &.prev,
40
+ &.active.left {
41
+ transform: translate3d(-100%, 0, 0);
42
+ left: 0;
43
+ }
44
+ &.next.left,
45
+ &.prev.right,
46
+ &.active {
47
+ transform: translate3d(0, 0, 0);
48
+ left: 0;
49
+ }
50
+ }
27
51
  }
28
52
 
29
53
  > .active,
@@ -32,6 +32,7 @@ kbd {
32
32
  kbd {
33
33
  padding: 0;
34
34
  font-size: 100%;
35
+ font-weight: bold;
35
36
  box-shadow: none;
36
37
  }
37
38
  }
@@ -17,8 +17,9 @@
17
17
 
18
18
  .collapse {
19
19
  display: none;
20
+ visibility: hidden;
20
21
 
21
- &.in { display: block; }
22
+ &.in { display: block; visibility: visible; }
22
23
  tr&.in { display: table-row; }
23
24
  tbody&.in { display: table-row-group; }
24
25
  }
@@ -27,5 +28,7 @@
27
28
  position: relative;
28
29
  height: 0;
29
30
  overflow: hidden;
30
- .transition(height .35s ease);
31
+ .transition-property(~"height, visibility");
32
+ .transition-duration(.35s);
33
+ .transition-timing-function(ease);
31
34
  }
@@ -103,16 +103,15 @@
103
103
  &:focus {
104
104
  color: @dropdown-link-disabled-color;
105
105
  }
106
- }
107
- // Nuke hover/focus effects
108
- .dropdown-menu > .disabled > a {
106
+
107
+ // Nuke hover/focus effects
109
108
  &:hover,
110
109
  &:focus {
111
110
  text-decoration: none;
112
111
  background-color: transparent;
113
112
  background-image: none; // Remove CSS gradient
114
113
  .reset-filter();
115
- cursor: not-allowed;
114
+ cursor: @cursor-disabled;
116
115
  }
117
116
  }
118
117
 
@@ -212,4 +211,3 @@
212
211
  }
213
212
  }
214
213
  }
215
-
@@ -141,7 +141,7 @@ output {
141
141
  &[disabled],
142
142
  &[readonly],
143
143
  fieldset[disabled] & {
144
- cursor: not-allowed;
144
+ cursor: @cursor-disabled;
145
145
  background-color: @input-bg-disabled;
146
146
  opacity: 1; // iOS fix for unreadable disabled content
147
147
  }
@@ -168,23 +168,27 @@ input[type="search"] {
168
168
  // Special styles for iOS temporal inputs
169
169
  //
170
170
  // In Mobile Safari, setting `display: block` on temporal inputs causes the
171
- // text within the input to become vertically misaligned.
172
- // As a workaround, we set a pixel line-height that matches the
173
- // given height of the input. Since this fucks up everything else, we have to
174
- // appropriately reset it for Internet Explorer and the size variations.
175
-
176
- input[type="date"],
177
- input[type="time"],
178
- input[type="datetime-local"],
179
- input[type="month"] {
180
- line-height: @input-height-base;
181
- // IE8+ misaligns the text within date inputs, so we reset
182
- line-height: @line-height-base ~"\0";
183
-
184
- &.input-sm {
171
+ // text within the input to become vertically misaligned. As a workaround, we
172
+ // set a pixel line-height that matches the given height of the input, but only
173
+ // for Safari.
174
+
175
+ @media screen and (-webkit-min-device-pixel-ratio: 0) {
176
+ input[type="date"],
177
+ input[type="time"],
178
+ input[type="datetime-local"],
179
+ input[type="month"] {
180
+ line-height: @input-height-base;
181
+ }
182
+ input[type="date"].input-sm,
183
+ input[type="time"].input-sm,
184
+ input[type="datetime-local"].input-sm,
185
+ input[type="month"].input-sm {
185
186
  line-height: @input-height-small;
186
187
  }
187
- &.input-lg {
188
+ input[type="date"].input-lg,
189
+ input[type="time"].input-lg,
190
+ input[type="datetime-local"].input-lg,
191
+ input[type="month"].input-lg {
188
192
  line-height: @input-height-large;
189
193
  }
190
194
  }
@@ -208,11 +212,11 @@ input[type="month"] {
208
212
  .checkbox {
209
213
  position: relative;
210
214
  display: block;
211
- min-height: @line-height-computed; // clear the floating input if there is no label text
212
215
  margin-top: 10px;
213
216
  margin-bottom: 10px;
214
217
 
215
218
  label {
219
+ min-height: @line-height-computed; // Ensure the input doesn't jump when there is no text
216
220
  padding-left: 20px;
217
221
  margin-bottom: 0;
218
222
  font-weight: normal;
@@ -258,7 +262,7 @@ input[type="checkbox"] {
258
262
  &[disabled],
259
263
  &.disabled,
260
264
  fieldset[disabled] & {
261
- cursor: not-allowed;
265
+ cursor: @cursor-disabled;
262
266
  }
263
267
  }
264
268
  // These classes are used directly on <label>s
@@ -266,7 +270,7 @@ input[type="checkbox"] {
266
270
  .checkbox-inline {
267
271
  &.disabled,
268
272
  fieldset[disabled] & {
269
- cursor: not-allowed;
273
+ cursor: @cursor-disabled;
270
274
  }
271
275
  }
272
276
  // These classes are used on elements with <label> descendants
@@ -275,7 +279,7 @@ input[type="checkbox"] {
275
279
  &.disabled,
276
280
  fieldset[disabled] & {
277
281
  label {
278
- cursor: not-allowed;
282
+ cursor: @cursor-disabled;
279
283
  }
280
284
  }
281
285
  }
@@ -306,12 +310,14 @@ input[type="checkbox"] {
306
310
  // Build on `.form-control` with modifier classes to decrease or increase the
307
311
  // height and font-size of form controls.
308
312
 
309
- .input-sm {
310
- .input-size(@input-height-small; @padding-small-vertical; @padding-small-horizontal; @font-size-small; @line-height-small; @border-radius-small);
313
+ .input-sm,
314
+ .form-group-sm .form-control {
315
+ .input-size(@input-height-small; @padding-small-vertical; @padding-small-horizontal; @font-size-small; @line-height-small; @input-border-radius-small);
311
316
  }
312
317
 
313
- .input-lg {
314
- .input-size(@input-height-large; @padding-large-vertical; @padding-large-horizontal; @font-size-large; @line-height-large; @border-radius-large);
318
+ .input-lg,
319
+ .form-group-lg .form-control {
320
+ .input-size(@input-height-large; @padding-large-vertical; @padding-large-horizontal; @font-size-large; @line-height-large; @input-border-radius-large);
315
321
  }
316
322
 
317
323
 
@@ -331,7 +337,7 @@ input[type="checkbox"] {
331
337
  // Feedback icon (requires .glyphicon classes)
332
338
  .form-control-feedback {
333
339
  position: absolute;
334
- top: (@line-height-computed + 5); // Height of the `label` and its margin
340
+ top: 0;
335
341
  right: 0;
336
342
  z-index: 2; // Ensure icon is above input groups
337
343
  display: block;
@@ -339,6 +345,7 @@ input[type="checkbox"] {
339
345
  height: @input-height-base;
340
346
  line-height: @input-height-base;
341
347
  text-align: center;
348
+ pointer-events: none;
342
349
  }
343
350
  .input-lg + .form-control-feedback {
344
351
  width: @input-height-large;
@@ -362,10 +369,15 @@ input[type="checkbox"] {
362
369
  .form-control-validation(@state-danger-text; @state-danger-text; @state-danger-bg);
363
370
  }
364
371
 
372
+ // Reposition feedback icon if input has visible label above
373
+ .has-feedback label {
365
374
 
366
- // Reposition feedback icon if label is hidden with "screenreader only" state
367
- .has-feedback label.sr-only ~ .form-control-feedback {
368
- top: 0;
375
+ & ~ .form-control-feedback {
376
+ top: (@line-height-computed + 5); // Height of the `label` and its margin
377
+ }
378
+ &.sr-only ~ .form-control-feedback {
379
+ top: 0;
380
+ }
369
381
  }
370
382
 
371
383
 
@@ -382,7 +394,6 @@ input[type="checkbox"] {
382
394
  }
383
395
 
384
396
 
385
-
386
397
  // Inline forms
387
398
  //
388
399
  // Make forms appear inline(-block) by adding the `.form-inline` class. Inline
@@ -412,6 +423,11 @@ input[type="checkbox"] {
412
423
  vertical-align: middle;
413
424
  }
414
425
 
426
+ // Make static controls behave like regular ones
427
+ .form-control-static {
428
+ display: inline-block;
429
+ }
430
+
415
431
  .input-group {
416
432
  display: inline-table;
417
433
  vertical-align: middle;
@@ -453,10 +469,7 @@ input[type="checkbox"] {
453
469
  margin-left: 0;
454
470
  }
455
471
 
456
- // Validation states
457
- //
458
- // Reposition the icon because it's now within a grid column and columns have
459
- // `position: relative;` on them. Also accounts for the grid gutter padding.
472
+ // Re-override the feedback icon.
460
473
  .has-feedback .form-control-feedback {
461
474
  top: 0;
462
475
  }
@@ -509,7 +522,6 @@ input[type="checkbox"] {
509
522
  // Reposition the icon because it's now within a grid column and columns have
510
523
  // `position: relative;` on them. Also accounts for the grid gutter padding.
511
524
  .has-feedback .form-control-feedback {
512
- top: 0;
513
525
  right: (@grid-gutter-width / 2);
514
526
  }
515
527
 
@@ -523,9 +535,6 @@ input[type="checkbox"] {
523
535
  padding-top: ((@padding-large-vertical * @line-height-large) + 1);
524
536
  }
525
537
  }
526
- .form-control {
527
- &:extend(.input-lg);
528
- }
529
538
  }
530
539
  .form-group-sm {
531
540
  @media (min-width: @screen-sm-min) {
@@ -533,8 +542,5 @@ input[type="checkbox"] {
533
542
  padding-top: (@padding-small-vertical + 1);
534
543
  }
535
544
  }
536
- .form-control {
537
- &:extend(.input-sm);
538
- }
539
545
  }
540
546
  }