bootswatch-sass 3.3.2 → 3.3.5

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/assets/javascripts/bootstrap/affix.js +5 -5
  3. data/assets/javascripts/bootstrap/alert.js +2 -2
  4. data/assets/javascripts/bootstrap/button.js +13 -9
  5. data/assets/javascripts/bootstrap/carousel.js +6 -6
  6. data/assets/javascripts/bootstrap/collapse.js +7 -7
  7. data/assets/javascripts/bootstrap/dropdown.js +47 -43
  8. data/assets/javascripts/bootstrap/modal.js +44 -31
  9. data/assets/javascripts/bootstrap/popover.js +3 -8
  10. data/assets/javascripts/bootstrap/scrollspy.js +17 -20
  11. data/assets/javascripts/bootstrap/tab.js +6 -4
  12. data/assets/javascripts/bootstrap/tooltip.js +73 -31
  13. data/assets/javascripts/bootstrap/transition.js +1 -1
  14. data/assets/stylesheets/_bootstrap.scss +6 -0
  15. data/assets/stylesheets/bootstrap/_alerts.scss +2 -2
  16. data/assets/stylesheets/bootstrap/_badges.scss +7 -6
  17. data/assets/stylesheets/bootstrap/_button-groups.scss +3 -2
  18. data/assets/stylesheets/bootstrap/_buttons.scss +13 -5
  19. data/assets/stylesheets/bootstrap/_carousel.scss +2 -2
  20. data/assets/stylesheets/bootstrap/_component-animations.scss +1 -2
  21. data/assets/stylesheets/bootstrap/_dropdowns.scss +4 -2
  22. data/assets/stylesheets/bootstrap/_forms.scss +56 -15
  23. data/assets/stylesheets/bootstrap/_glyphicons.scss +15 -9
  24. data/assets/stylesheets/bootstrap/_input-groups.scss +1 -0
  25. data/assets/stylesheets/bootstrap/_jumbotron.scss +6 -4
  26. data/assets/stylesheets/bootstrap/_list-group.scss +9 -3
  27. data/assets/stylesheets/bootstrap/_media.scss +5 -0
  28. data/assets/stylesheets/bootstrap/_mixins.scss +1 -0
  29. data/assets/stylesheets/bootstrap/_modals.scss +3 -1
  30. data/assets/stylesheets/bootstrap/_navbar.scss +0 -1
  31. data/assets/stylesheets/bootstrap/_navs.scss +0 -2
  32. data/assets/stylesheets/bootstrap/_normalize.scss +8 -11
  33. data/assets/stylesheets/bootstrap/_pagination.scss +3 -2
  34. data/assets/stylesheets/bootstrap/_panels.scss +6 -0
  35. data/assets/stylesheets/bootstrap/_popovers.scss +4 -8
  36. data/assets/stylesheets/bootstrap/_print.scss +0 -6
  37. data/assets/stylesheets/bootstrap/_responsive-embed.scss +8 -8
  38. data/assets/stylesheets/bootstrap/_responsive-utilities.scss +4 -2
  39. data/assets/stylesheets/bootstrap/_scaffolding.scss +11 -0
  40. data/assets/stylesheets/bootstrap/_theme.scss +23 -5
  41. data/assets/stylesheets/bootstrap/_tooltip.scss +4 -6
  42. data/assets/stylesheets/bootstrap/_type.scss +1 -1
  43. data/assets/stylesheets/bootstrap/_utilities.scss +0 -1
  44. data/assets/stylesheets/bootstrap/_variables.scss +12 -2
  45. data/assets/stylesheets/bootstrap/mixins/_background-variant.scss +2 -1
  46. data/assets/stylesheets/bootstrap/mixins/_buttons.scss +18 -2
  47. data/assets/stylesheets/bootstrap/mixins/_grid-framework.scss +2 -2
  48. data/assets/stylesheets/bootstrap/mixins/_grid.scss +2 -2
  49. data/assets/stylesheets/bootstrap/mixins/_hide-text.scss +1 -1
  50. data/assets/stylesheets/bootstrap/mixins/_list-group.scss +3 -2
  51. data/assets/stylesheets/bootstrap/mixins/_pagination.scss +2 -1
  52. data/assets/stylesheets/bootstrap/mixins/_reset-text.scss +18 -0
  53. data/assets/stylesheets/bootstrap/mixins/_responsive-visibility.scss +1 -1
  54. data/assets/stylesheets/bootstrap/mixins/_text-emphasis.scss +2 -1
  55. data/assets/stylesheets/cerulean/_bootswatch.scss +7 -1
  56. data/assets/stylesheets/cerulean/_variables.scss +392 -381
  57. data/assets/stylesheets/cosmo/_bootswatch.scss +26 -2
  58. data/assets/stylesheets/cosmo/_variables.scss +392 -381
  59. data/assets/stylesheets/cyborg/_bootswatch.scss +26 -2
  60. data/assets/stylesheets/cyborg/_variables.scss +392 -381
  61. data/assets/stylesheets/darkly/_bootswatch.scss +22 -4
  62. data/assets/stylesheets/darkly/_variables.scss +392 -381
  63. data/assets/stylesheets/flatly/_bootswatch.scss +21 -3
  64. data/assets/stylesheets/flatly/_variables.scss +392 -381
  65. data/assets/stylesheets/journal/_bootswatch.scss +26 -2
  66. data/assets/stylesheets/journal/_variables.scss +392 -381
  67. data/assets/stylesheets/lumen/_bootswatch.scss +47 -8
  68. data/assets/stylesheets/lumen/_variables.scss +392 -381
  69. data/assets/stylesheets/paper/_bootswatch.scss +214 -76
  70. data/assets/stylesheets/paper/_variables.scss +392 -381
  71. data/assets/stylesheets/readable/_bootswatch.scss +16 -24
  72. data/assets/stylesheets/readable/_variables.scss +392 -381
  73. data/assets/stylesheets/sandstone/_bootswatch.scss +7 -4
  74. data/assets/stylesheets/sandstone/_variables.scss +392 -381
  75. data/assets/stylesheets/simplex/_bootswatch.scss +32 -5
  76. data/assets/stylesheets/simplex/_variables.scss +392 -381
  77. data/assets/stylesheets/slate/_bootswatch.scss +25 -1
  78. data/assets/stylesheets/slate/_variables.scss +392 -381
  79. data/assets/stylesheets/spacelab/_bootswatch.scss +4 -4
  80. data/assets/stylesheets/spacelab/_variables.scss +392 -381
  81. data/assets/stylesheets/superhero/_bootswatch.scss +26 -2
  82. data/assets/stylesheets/superhero/_variables.scss +392 -381
  83. data/assets/stylesheets/united/_bootswatch.scss +15 -2
  84. data/assets/stylesheets/united/_variables.scss +392 -381
  85. data/assets/stylesheets/yeti/_bootswatch.scss +2 -2
  86. data/assets/stylesheets/yeti/_variables.scss +392 -381
  87. data/lib/bootswatch-sass/version.rb +1 -1
  88. data/test/dummy/Gemfile +7 -5
  89. data/test/dummy/app/views/home/index.html.erb +1 -1
  90. metadata +4 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c0d2529c0723e694047290f5cf7cc443d7ab26d4
4
- data.tar.gz: a83e0642b7f0d5290913acea38a09e741f4bfcb8
3
+ metadata.gz: 8e7b0ce47e9b82eebbf78ed7d51bcb77c7d76c38
4
+ data.tar.gz: 71a462b4a1177185a350a3709cd82f913610f6e1
5
5
  SHA512:
6
- metadata.gz: 20ad7268dcbdc251e9571046435606e654ec9ed57acb90300b90dbc75e26b57cdc28ff61019dede13b98a95defcfb6585c9e5dbabd4203f8a3c3a29511120380
7
- data.tar.gz: 8830ce7ce3ed1b2c835760983df6a6ffcbdd63bf03062746336dbff413c47d408c68554e9604644faa75762e22f7608f6c20d74d9e99781ea0c244915332bc24
6
+ metadata.gz: 31b810895bcec33907bf923845d8386b118fe6c7532c00f3d9b3fdc8d2c20af58904aed87330ea8552a562e0923f42b90acb08f37197d1bfbc6f43b08d564dbb
7
+ data.tar.gz: 6fc96cebe1759b857b65cd8fd1d6cbbaf98daee65d645edb1663cbe64759e2032ee1e0928ef4ba803b25ac2ea97217961f763f433986488ec670a25c43f8f601
@@ -1,5 +1,5 @@
1
1
  /* ========================================================================
2
- * Bootstrap: affix.js v3.3.2
2
+ * Bootstrap: affix.js v3.3.5
3
3
  * http://getbootstrap.com/javascript/#affix
4
4
  * ========================================================================
5
5
  * Copyright 2011-2015 Twitter, Inc.
@@ -21,14 +21,14 @@
21
21
  .on('click.bs.affix.data-api', $.proxy(this.checkPositionWithEventLoop, this))
22
22
 
23
23
  this.$element = $(element)
24
- this.affixed =
25
- this.unpin =
24
+ this.affixed = null
25
+ this.unpin = null
26
26
  this.pinnedOffset = null
27
27
 
28
28
  this.checkPosition()
29
29
  }
30
30
 
31
- Affix.VERSION = '3.3.2'
31
+ Affix.VERSION = '3.3.5'
32
32
 
33
33
  Affix.RESET = 'affix affix-top affix-bottom'
34
34
 
@@ -78,7 +78,7 @@
78
78
  var offset = this.options.offset
79
79
  var offsetTop = offset.top
80
80
  var offsetBottom = offset.bottom
81
- var scrollHeight = $('body').height()
81
+ var scrollHeight = Math.max($(document).height(), $(document.body).height())
82
82
 
83
83
  if (typeof offset != 'object') offsetBottom = offsetTop = offset
84
84
  if (typeof offsetTop == 'function') offsetTop = offset.top(this.$element)
@@ -1,5 +1,5 @@
1
1
  /* ========================================================================
2
- * Bootstrap: alert.js v3.3.2
2
+ * Bootstrap: alert.js v3.3.5
3
3
  * http://getbootstrap.com/javascript/#alerts
4
4
  * ========================================================================
5
5
  * Copyright 2011-2015 Twitter, Inc.
@@ -18,7 +18,7 @@
18
18
  $(el).on('click', dismiss, this.close)
19
19
  }
20
20
 
21
- Alert.VERSION = '3.3.2'
21
+ Alert.VERSION = '3.3.5'
22
22
 
23
23
  Alert.TRANSITION_DURATION = 150
24
24
 
@@ -1,5 +1,5 @@
1
1
  /* ========================================================================
2
- * Bootstrap: button.js v3.3.2
2
+ * Bootstrap: button.js v3.3.5
3
3
  * http://getbootstrap.com/javascript/#buttons
4
4
  * ========================================================================
5
5
  * Copyright 2011-2015 Twitter, Inc.
@@ -19,7 +19,7 @@
19
19
  this.isLoading = false
20
20
  }
21
21
 
22
- Button.VERSION = '3.3.2'
22
+ Button.VERSION = '3.3.5'
23
23
 
24
24
  Button.DEFAULTS = {
25
25
  loadingText: 'loading...'
@@ -31,7 +31,7 @@
31
31
  var val = $el.is('input') ? 'val' : 'html'
32
32
  var data = $el.data()
33
33
 
34
- state = state + 'Text'
34
+ state += 'Text'
35
35
 
36
36
  if (data.resetText == null) $el.data('resetText', $el[val]())
37
37
 
@@ -56,15 +56,19 @@
56
56
  if ($parent.length) {
57
57
  var $input = this.$element.find('input')
58
58
  if ($input.prop('type') == 'radio') {
59
- if ($input.prop('checked') && this.$element.hasClass('active')) changed = false
60
- else $parent.find('.active').removeClass('active')
59
+ if ($input.prop('checked')) changed = false
60
+ $parent.find('.active').removeClass('active')
61
+ this.$element.addClass('active')
62
+ } else if ($input.prop('type') == 'checkbox') {
63
+ if (($input.prop('checked')) !== this.$element.hasClass('active')) changed = false
64
+ this.$element.toggleClass('active')
61
65
  }
62
- if (changed) $input.prop('checked', !this.$element.hasClass('active')).trigger('change')
66
+ $input.prop('checked', this.$element.hasClass('active'))
67
+ if (changed) $input.trigger('change')
63
68
  } else {
64
69
  this.$element.attr('aria-pressed', !this.$element.hasClass('active'))
70
+ this.$element.toggleClass('active')
65
71
  }
66
-
67
- if (changed) this.$element.toggleClass('active')
68
72
  }
69
73
 
70
74
 
@@ -107,7 +111,7 @@
107
111
  var $btn = $(e.target)
108
112
  if (!$btn.hasClass('btn')) $btn = $btn.closest('.btn')
109
113
  Plugin.call($btn, 'toggle')
110
- e.preventDefault()
114
+ if (!($(e.target).is('input[type="radio"]') || $(e.target).is('input[type="checkbox"]'))) e.preventDefault()
111
115
  })
112
116
  .on('focus.bs.button.data-api blur.bs.button.data-api', '[data-toggle^="button"]', function (e) {
113
117
  $(e.target).closest('.btn').toggleClass('focus', /^focus(in)?$/.test(e.type))
@@ -1,5 +1,5 @@
1
1
  /* ========================================================================
2
- * Bootstrap: carousel.js v3.3.2
2
+ * Bootstrap: carousel.js v3.3.5
3
3
  * http://getbootstrap.com/javascript/#carousel
4
4
  * ========================================================================
5
5
  * Copyright 2011-2015 Twitter, Inc.
@@ -17,10 +17,10 @@
17
17
  this.$element = $(element)
18
18
  this.$indicators = this.$element.find('.carousel-indicators')
19
19
  this.options = options
20
- this.paused =
21
- this.sliding =
22
- this.interval =
23
- this.$active =
20
+ this.paused = null
21
+ this.sliding = null
22
+ this.interval = null
23
+ this.$active = null
24
24
  this.$items = null
25
25
 
26
26
  this.options.keyboard && this.$element.on('keydown.bs.carousel', $.proxy(this.keydown, this))
@@ -30,7 +30,7 @@
30
30
  .on('mouseleave.bs.carousel', $.proxy(this.cycle, this))
31
31
  }
32
32
 
33
- Carousel.VERSION = '3.3.2'
33
+ Carousel.VERSION = '3.3.5'
34
34
 
35
35
  Carousel.TRANSITION_DURATION = 600
36
36
 
@@ -1,5 +1,5 @@
1
1
  /* ========================================================================
2
- * Bootstrap: collapse.js v3.3.2
2
+ * Bootstrap: collapse.js v3.3.5
3
3
  * http://getbootstrap.com/javascript/#collapse
4
4
  * ========================================================================
5
5
  * Copyright 2011-2015 Twitter, Inc.
@@ -16,7 +16,8 @@
16
16
  var Collapse = function (element, options) {
17
17
  this.$element = $(element)
18
18
  this.options = $.extend({}, Collapse.DEFAULTS, options)
19
- this.$trigger = $(this.options.trigger).filter('[href="#' + element.id + '"], [data-target="#' + element.id + '"]')
19
+ this.$trigger = $('[data-toggle="collapse"][href="#' + element.id + '"],' +
20
+ '[data-toggle="collapse"][data-target="#' + element.id + '"]')
20
21
  this.transitioning = null
21
22
 
22
23
  if (this.options.parent) {
@@ -28,13 +29,12 @@
28
29
  if (this.options.toggle) this.toggle()
29
30
  }
30
31
 
31
- Collapse.VERSION = '3.3.2'
32
+ Collapse.VERSION = '3.3.5'
32
33
 
33
34
  Collapse.TRANSITION_DURATION = 350
34
35
 
35
36
  Collapse.DEFAULTS = {
36
- toggle: true,
37
- trigger: '[data-toggle="collapse"]'
37
+ toggle: true
38
38
  }
39
39
 
40
40
  Collapse.prototype.dimension = function () {
@@ -172,7 +172,7 @@
172
172
  var data = $this.data('bs.collapse')
173
173
  var options = $.extend({}, Collapse.DEFAULTS, $this.data(), typeof option == 'object' && option)
174
174
 
175
- if (!data && options.toggle && option == 'show') options.toggle = false
175
+ if (!data && options.toggle && /show|hide/.test(option)) options.toggle = false
176
176
  if (!data) $this.data('bs.collapse', (data = new Collapse(this, options)))
177
177
  if (typeof option == 'string') data[option]()
178
178
  })
@@ -203,7 +203,7 @@
203
203
 
204
204
  var $target = getTargetFromTrigger($this)
205
205
  var data = $target.data('bs.collapse')
206
- var option = data ? 'toggle' : $.extend({}, $this.data(), { trigger: this })
206
+ var option = data ? 'toggle' : $this.data()
207
207
 
208
208
  Plugin.call($target, option)
209
209
  })
@@ -1,5 +1,5 @@
1
1
  /* ========================================================================
2
- * Bootstrap: dropdown.js v3.3.2
2
+ * Bootstrap: dropdown.js v3.3.5
3
3
  * http://getbootstrap.com/javascript/#dropdowns
4
4
  * ========================================================================
5
5
  * Copyright 2011-2015 Twitter, Inc.
@@ -19,7 +19,41 @@
19
19
  $(element).on('click.bs.dropdown', this.toggle)
20
20
  }
21
21
 
22
- Dropdown.VERSION = '3.3.2'
22
+ Dropdown.VERSION = '3.3.5'
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 && $(selector)
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('hidden.bs.dropdown', relatedTarget)
55
+ })
56
+ }
23
57
 
24
58
  Dropdown.prototype.toggle = function (e) {
25
59
  var $this = $(this)
@@ -34,7 +68,10 @@
34
68
  if (!isActive) {
35
69
  if ('ontouchstart' in document.documentElement && !$parent.closest('.navbar-nav').length) {
36
70
  // if mobile we use a backdrop because click events don't delegate
37
- $('<div class="dropdown-backdrop"/>').insertAfter($(this)).on('click', clearMenus)
71
+ $(document.createElement('div'))
72
+ .addClass('dropdown-backdrop')
73
+ .insertAfter($(this))
74
+ .on('click', clearMenus)
38
75
  }
39
76
 
40
77
  var relatedTarget = { relatedTarget: this }
@@ -67,57 +104,25 @@
67
104
  var $parent = getParent($this)
68
105
  var isActive = $parent.hasClass('open')
69
106
 
70
- if ((!isActive && e.which != 27) || (isActive && e.which == 27)) {
107
+ if (!isActive && e.which != 27 || isActive && e.which == 27) {
71
108
  if (e.which == 27) $parent.find(toggle).trigger('focus')
72
109
  return $this.trigger('click')
73
110
  }
74
111
 
75
- var desc = ' li:not(.divider):visible a'
76
- var $items = $parent.find('[role="menu"]' + desc + ', [role="listbox"]' + desc)
112
+ var desc = ' li:not(.disabled):visible a'
113
+ var $items = $parent.find('.dropdown-menu' + desc)
77
114
 
78
115
  if (!$items.length) return
79
116
 
80
117
  var index = $items.index(e.target)
81
118
 
82
- if (e.which == 38 && index > 0) index-- // up
83
- if (e.which == 40 && index < $items.length - 1) index++ // down
84
- if (!~index) index = 0
119
+ if (e.which == 38 && index > 0) index-- // up
120
+ if (e.which == 40 && index < $items.length - 1) index++ // down
121
+ if (!~index) index = 0
85
122
 
86
123
  $items.eq(index).trigger('focus')
87
124
  }
88
125
 
89
- function clearMenus(e) {
90
- if (e && e.which === 3) return
91
- $(backdrop).remove()
92
- $(toggle).each(function () {
93
- var $this = $(this)
94
- var $parent = getParent($this)
95
- var relatedTarget = { relatedTarget: this }
96
-
97
- if (!$parent.hasClass('open')) return
98
-
99
- $parent.trigger(e = $.Event('hide.bs.dropdown', relatedTarget))
100
-
101
- if (e.isDefaultPrevented()) return
102
-
103
- $this.attr('aria-expanded', 'false')
104
- $parent.removeClass('open').trigger('hidden.bs.dropdown', relatedTarget)
105
- })
106
- }
107
-
108
- function getParent($this) {
109
- var selector = $this.attr('data-target')
110
-
111
- if (!selector) {
112
- selector = $this.attr('href')
113
- selector = selector && /#[A-Za-z]/.test(selector) && selector.replace(/.*(?=#[^\s]*$)/, '') // strip for ie7
114
- }
115
-
116
- var $parent = selector && $(selector)
117
-
118
- return $parent && $parent.length ? $parent : $this.parent()
119
- }
120
-
121
126
 
122
127
  // DROPDOWN PLUGIN DEFINITION
123
128
  // ==========================
@@ -155,7 +160,6 @@
155
160
  .on('click.bs.dropdown.data-api', '.dropdown form', function (e) { e.stopPropagation() })
156
161
  .on('click.bs.dropdown.data-api', toggle, Dropdown.prototype.toggle)
157
162
  .on('keydown.bs.dropdown.data-api', toggle, Dropdown.prototype.keydown)
158
- .on('keydown.bs.dropdown.data-api', '[role="menu"]', Dropdown.prototype.keydown)
159
- .on('keydown.bs.dropdown.data-api', '[role="listbox"]', Dropdown.prototype.keydown)
163
+ .on('keydown.bs.dropdown.data-api', '.dropdown-menu', Dropdown.prototype.keydown)
160
164
 
161
165
  }(jQuery);
@@ -1,5 +1,5 @@
1
1
  /* ========================================================================
2
- * Bootstrap: modal.js v3.3.2
2
+ * Bootstrap: modal.js v3.3.5
3
3
  * http://getbootstrap.com/javascript/#modals
4
4
  * ========================================================================
5
5
  * Copyright 2011-2015 Twitter, Inc.
@@ -14,12 +14,15 @@
14
14
  // ======================
15
15
 
16
16
  var Modal = function (element, options) {
17
- this.options = options
18
- this.$body = $(document.body)
19
- this.$element = $(element)
20
- this.$backdrop =
21
- this.isShown = null
22
- this.scrollbarWidth = 0
17
+ this.options = options
18
+ this.$body = $(document.body)
19
+ this.$element = $(element)
20
+ this.$dialog = this.$element.find('.modal-dialog')
21
+ this.$backdrop = null
22
+ this.isShown = null
23
+ this.originalBodyPad = null
24
+ this.scrollbarWidth = 0
25
+ this.ignoreBackdropClick = false
23
26
 
24
27
  if (this.options.remote) {
25
28
  this.$element
@@ -30,7 +33,7 @@
30
33
  }
31
34
  }
32
35
 
33
- Modal.VERSION = '3.3.2'
36
+ Modal.VERSION = '3.3.5'
34
37
 
35
38
  Modal.TRANSITION_DURATION = 300
36
39
  Modal.BACKDROP_TRANSITION_DURATION = 150
@@ -64,6 +67,12 @@
64
67
 
65
68
  this.$element.on('click.dismiss.bs.modal', '[data-dismiss="modal"]', $.proxy(this.hide, this))
66
69
 
70
+ this.$dialog.on('mousedown.dismiss.bs.modal', function () {
71
+ that.$element.one('mouseup.dismiss.bs.modal', function (e) {
72
+ if ($(e.target).is(that.$element)) that.ignoreBackdropClick = true
73
+ })
74
+ })
75
+
67
76
  this.backdrop(function () {
68
77
  var transition = $.support.transition && that.$element.hasClass('fade')
69
78
 
@@ -75,23 +84,20 @@
75
84
  .show()
76
85
  .scrollTop(0)
77
86
 
78
- if (that.options.backdrop) that.adjustBackdrop()
79
87
  that.adjustDialog()
80
88
 
81
89
  if (transition) {
82
90
  that.$element[0].offsetWidth // force reflow
83
91
  }
84
92
 
85
- that.$element
86
- .addClass('in')
87
- .attr('aria-hidden', false)
93
+ that.$element.addClass('in')
88
94
 
89
95
  that.enforceFocus()
90
96
 
91
97
  var e = $.Event('shown.bs.modal', { relatedTarget: _relatedTarget })
92
98
 
93
99
  transition ?
94
- that.$element.find('.modal-dialog') // wait for modal to slide in
100
+ that.$dialog // wait for modal to slide in
95
101
  .one('bsTransitionEnd', function () {
96
102
  that.$element.trigger('focus').trigger(e)
97
103
  })
@@ -118,8 +124,10 @@
118
124
 
119
125
  this.$element
120
126
  .removeClass('in')
121
- .attr('aria-hidden', true)
122
127
  .off('click.dismiss.bs.modal')
128
+ .off('mouseup.dismiss.bs.modal')
129
+
130
+ this.$dialog.off('mousedown.dismiss.bs.modal')
123
131
 
124
132
  $.support.transition && this.$element.hasClass('fade') ?
125
133
  this.$element
@@ -179,14 +187,20 @@
179
187
  if (this.isShown && this.options.backdrop) {
180
188
  var doAnimate = $.support.transition && animate
181
189
 
182
- this.$backdrop = $('<div class="modal-backdrop ' + animate + '" />')
183
- .prependTo(this.$element)
184
- .on('click.dismiss.bs.modal', $.proxy(function (e) {
185
- if (e.target !== e.currentTarget) return
186
- this.options.backdrop == 'static'
187
- ? this.$element[0].focus.call(this.$element[0])
188
- : this.hide.call(this)
189
- }, this))
190
+ this.$backdrop = $(document.createElement('div'))
191
+ .addClass('modal-backdrop ' + animate)
192
+ .appendTo(this.$body)
193
+
194
+ this.$element.on('click.dismiss.bs.modal', $.proxy(function (e) {
195
+ if (this.ignoreBackdropClick) {
196
+ this.ignoreBackdropClick = false
197
+ return
198
+ }
199
+ if (e.target !== e.currentTarget) return
200
+ this.options.backdrop == 'static'
201
+ ? this.$element[0].focus()
202
+ : this.hide()
203
+ }, this))
190
204
 
191
205
  if (doAnimate) this.$backdrop[0].offsetWidth // force reflow
192
206
 
@@ -221,16 +235,9 @@
221
235
  // these following methods are used to handle overflowing modals
222
236
 
223
237
  Modal.prototype.handleUpdate = function () {
224
- if (this.options.backdrop) this.adjustBackdrop()
225
238
  this.adjustDialog()
226
239
  }
227
240
 
228
- Modal.prototype.adjustBackdrop = function () {
229
- this.$backdrop
230
- .css('height', 0)
231
- .css('height', this.$element[0].scrollHeight)
232
- }
233
-
234
241
  Modal.prototype.adjustDialog = function () {
235
242
  var modalIsOverflowing = this.$element[0].scrollHeight > document.documentElement.clientHeight
236
243
 
@@ -248,17 +255,23 @@
248
255
  }
249
256
 
250
257
  Modal.prototype.checkScrollbar = function () {
251
- this.bodyIsOverflowing = document.body.scrollHeight > document.documentElement.clientHeight
258
+ var fullWindowWidth = window.innerWidth
259
+ if (!fullWindowWidth) { // workaround for missing window.innerWidth in IE8
260
+ var documentElementRect = document.documentElement.getBoundingClientRect()
261
+ fullWindowWidth = documentElementRect.right - Math.abs(documentElementRect.left)
262
+ }
263
+ this.bodyIsOverflowing = document.body.clientWidth < fullWindowWidth
252
264
  this.scrollbarWidth = this.measureScrollbar()
253
265
  }
254
266
 
255
267
  Modal.prototype.setScrollbar = function () {
256
268
  var bodyPad = parseInt((this.$body.css('padding-right') || 0), 10)
269
+ this.originalBodyPad = document.body.style.paddingRight || ''
257
270
  if (this.bodyIsOverflowing) this.$body.css('padding-right', bodyPad + this.scrollbarWidth)
258
271
  }
259
272
 
260
273
  Modal.prototype.resetScrollbar = function () {
261
- this.$body.css('padding-right', '')
274
+ this.$body.css('padding-right', this.originalBodyPad)
262
275
  }
263
276
 
264
277
  Modal.prototype.measureScrollbar = function () { // thx walsh