bootstrap-generators 2.0.4 → 2.1.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (104) hide show
  1. data/README.md +211 -63
  2. data/lib/bootstrap/generators/version.rb +1 -1
  3. data/lib/generators/bootstrap/install/templates/assets/stylesheets/bootstrap-variables.css.scss +102 -28
  4. data/lib/generators/bootstrap/install/templates/assets/stylesheets/bootstrap-variables.less +104 -31
  5. data/vendor/assets/images/glyphicons-halflings.png +0 -0
  6. data/vendor/assets/javascripts/bootstrap-affix.js +104 -0
  7. data/vendor/assets/javascripts/bootstrap-alert.js +1 -1
  8. data/vendor/assets/javascripts/bootstrap-button.js +2 -2
  9. data/vendor/assets/javascripts/bootstrap-carousel.js +12 -5
  10. data/vendor/assets/javascripts/bootstrap-collapse.js +4 -3
  11. data/vendor/assets/javascripts/bootstrap-dropdown.js +66 -16
  12. data/vendor/assets/javascripts/bootstrap-modal.js +95 -74
  13. data/vendor/assets/javascripts/bootstrap-popover.js +9 -4
  14. data/vendor/assets/javascripts/bootstrap-scrollspy.js +9 -9
  15. data/vendor/assets/javascripts/bootstrap-tab.js +2 -2
  16. data/vendor/assets/javascripts/bootstrap-tooltip.js +15 -15
  17. data/vendor/assets/javascripts/bootstrap-transition.js +2 -3
  18. data/vendor/assets/javascripts/bootstrap-typeahead.js +51 -36
  19. data/vendor/assets/javascripts/bootstrap.js +1 -1
  20. data/vendor/assets/stylesheets/bootstrap-responsive.css +1058 -0
  21. data/vendor/assets/stylesheets/bootstrap-responsive.min.css +9 -0
  22. data/vendor/assets/stylesheets/bootstrap.css +5774 -0
  23. data/vendor/assets/stylesheets/bootstrap.min.css +9 -0
  24. data/vendor/twitter/bootstrap/less/accordion.less +3 -2
  25. data/vendor/twitter/bootstrap/less/alerts.less +16 -9
  26. data/vendor/twitter/bootstrap/less/bootstrap.less +1 -1
  27. data/vendor/twitter/bootstrap/less/breadcrumbs.less +10 -10
  28. data/vendor/twitter/bootstrap/less/button-groups.less +79 -25
  29. data/vendor/twitter/bootstrap/less/buttons.less +107 -67
  30. data/vendor/twitter/bootstrap/less/carousel.less +13 -3
  31. data/vendor/twitter/bootstrap/less/close.less +4 -2
  32. data/vendor/twitter/bootstrap/less/code.less +6 -5
  33. data/vendor/twitter/bootstrap/less/component-animations.less +4 -2
  34. data/vendor/twitter/bootstrap/less/dropdowns.less +82 -15
  35. data/vendor/twitter/bootstrap/less/forms.less +124 -57
  36. data/vendor/twitter/bootstrap/less/grid.less +17 -1
  37. data/vendor/twitter/bootstrap/less/hero-unit.less +4 -2
  38. data/vendor/twitter/bootstrap/less/labels-badges.less +19 -2
  39. data/vendor/twitter/bootstrap/less/layouts.less +1 -2
  40. data/vendor/twitter/bootstrap/less/mixins.less +112 -77
  41. data/vendor/twitter/bootstrap/less/modals.less +12 -4
  42. data/vendor/twitter/bootstrap/less/navbar.less +245 -128
  43. data/vendor/twitter/bootstrap/less/navs.less +38 -17
  44. data/vendor/twitter/bootstrap/less/pager.less +11 -7
  45. data/vendor/twitter/bootstrap/less/pagination.less +23 -15
  46. data/vendor/twitter/bootstrap/less/popovers.less +101 -33
  47. data/vendor/twitter/bootstrap/less/progress-bars.less +18 -13
  48. data/vendor/twitter/bootstrap/less/reset.less +10 -4
  49. data/vendor/twitter/bootstrap/less/responsive-1200px-min.less +9 -7
  50. data/vendor/twitter/bootstrap/less/responsive-767px-max.less +95 -70
  51. data/vendor/twitter/bootstrap/less/responsive-768px-979px.less +7 -5
  52. data/vendor/twitter/bootstrap/less/responsive-navbar.less +30 -6
  53. data/vendor/twitter/bootstrap/less/responsive-utilities.less +17 -15
  54. data/vendor/twitter/bootstrap/less/responsive.less +5 -5
  55. data/vendor/twitter/bootstrap/less/scaffolding.less +27 -4
  56. data/vendor/twitter/bootstrap/less/sprites.less +21 -19
  57. data/vendor/twitter/bootstrap/less/tables.less +81 -12
  58. data/vendor/twitter/bootstrap/less/thumbnails.less +9 -4
  59. data/vendor/twitter/bootstrap/less/tooltip.less +47 -12
  60. data/vendor/twitter/bootstrap/less/type.less +75 -86
  61. data/vendor/twitter/bootstrap/less/utilities.less +9 -2
  62. data/vendor/twitter/bootstrap/less/variables.less +104 -31
  63. data/vendor/twitter/bootstrap/less/wells.less +7 -5
  64. data/vendor/twitter/bootstrap/sass/_accordion.scss +3 -2
  65. data/vendor/twitter/bootstrap/sass/_alerts.scss +15 -8
  66. data/vendor/twitter/bootstrap/sass/_breadcrumbs.scss +10 -10
  67. data/vendor/twitter/bootstrap/sass/_button-groups.scss +77 -23
  68. data/vendor/twitter/bootstrap/sass/_buttons.scss +106 -66
  69. data/vendor/twitter/bootstrap/sass/_carousel.scss +13 -3
  70. data/vendor/twitter/bootstrap/sass/_close.scss +5 -3
  71. data/vendor/twitter/bootstrap/sass/_code.scss +7 -6
  72. data/vendor/twitter/bootstrap/sass/_component-animations.scss +5 -3
  73. data/vendor/twitter/bootstrap/sass/_dropdowns.scss +85 -18
  74. data/vendor/twitter/bootstrap/sass/_forms.scss +121 -53
  75. data/vendor/twitter/bootstrap/sass/_grid.scss +17 -1
  76. data/vendor/twitter/bootstrap/sass/_hero-unit.scss +4 -2
  77. data/vendor/twitter/bootstrap/sass/_labels-badges.scss +29 -12
  78. data/vendor/twitter/bootstrap/sass/_layouts.scss +2 -3
  79. data/vendor/twitter/bootstrap/sass/_mixins.scss +163 -127
  80. data/vendor/twitter/bootstrap/sass/_modals.scss +12 -4
  81. data/vendor/twitter/bootstrap/sass/_navbar.scss +243 -127
  82. data/vendor/twitter/bootstrap/sass/_navs.scss +36 -15
  83. data/vendor/twitter/bootstrap/sass/_pager.scss +12 -8
  84. data/vendor/twitter/bootstrap/sass/_pagination.scss +23 -15
  85. data/vendor/twitter/bootstrap/sass/_popovers.scss +101 -33
  86. data/vendor/twitter/bootstrap/sass/_progress-bars.scss +18 -13
  87. data/vendor/twitter/bootstrap/sass/_reset.scss +8 -3
  88. data/vendor/twitter/bootstrap/sass/_responsive-1200px-min.scss +9 -7
  89. data/vendor/twitter/bootstrap/sass/_responsive-767px-max.scss +95 -70
  90. data/vendor/twitter/bootstrap/sass/_responsive-768px-979px.scss +8 -6
  91. data/vendor/twitter/bootstrap/sass/_responsive-navbar.scss +29 -5
  92. data/vendor/twitter/bootstrap/sass/_responsive-utilities.scss +32 -15
  93. data/vendor/twitter/bootstrap/sass/_scaffolding.scss +29 -4
  94. data/vendor/twitter/bootstrap/sass/_sprites.scss +21 -19
  95. data/vendor/twitter/bootstrap/sass/_tables.scss +79 -11
  96. data/vendor/twitter/bootstrap/sass/_thumbnails.scss +9 -4
  97. data/vendor/twitter/bootstrap/sass/_tooltip.scss +47 -12
  98. data/vendor/twitter/bootstrap/sass/_type.scss +74 -85
  99. data/vendor/twitter/bootstrap/sass/_utilities.scss +24 -2
  100. data/vendor/twitter/bootstrap/sass/_variables.scss +102 -28
  101. data/vendor/twitter/bootstrap/sass/_wells.scss +7 -5
  102. data/vendor/twitter/bootstrap/sass/bootstrap.scss +1 -1
  103. data/vendor/twitter/bootstrap/sass/responsive.scss +5 -5
  104. metadata +15 -10
@@ -1,5 +1,5 @@
1
1
  /* ==========================================================
2
- * bootstrap-alert.js v2.0.4
2
+ * bootstrap-alert.js v2.1.1
3
3
  * http://twitter.github.com/bootstrap/javascript.html#alerts
4
4
  * ==========================================================
5
5
  * Copyright 2012 Twitter, Inc.
@@ -1,5 +1,5 @@
1
1
  /* ============================================================
2
- * bootstrap-button.js v2.0.4
2
+ * bootstrap-button.js v2.1.1
3
3
  * http://twitter.github.com/bootstrap/javascript.html#buttons
4
4
  * ============================================================
5
5
  * Copyright 2012 Twitter, Inc.
@@ -51,7 +51,7 @@
51
51
  }
52
52
 
53
53
  Button.prototype.toggle = function () {
54
- var $parent = this.$element.parent('[data-toggle="buttons-radio"]')
54
+ var $parent = this.$element.closest('[data-toggle="buttons-radio"]')
55
55
 
56
56
  $parent && $parent
57
57
  .find('.active')
@@ -1,5 +1,5 @@
1
1
  /* ==========================================================
2
- * bootstrap-carousel.js v2.0.4
2
+ * bootstrap-carousel.js v2.1.1
3
3
  * http://twitter.github.com/bootstrap/javascript.html#carousel
4
4
  * ==========================================================
5
5
  * Copyright 2012 Twitter, Inc.
@@ -46,7 +46,7 @@
46
46
  }
47
47
 
48
48
  , to: function (pos) {
49
- var $active = this.$element.find('.active')
49
+ var $active = this.$element.find('.item.active')
50
50
  , children = $active.parent().children()
51
51
  , activePos = children.index($active)
52
52
  , that = this
@@ -68,6 +68,10 @@
68
68
 
69
69
  , pause: function (e) {
70
70
  if (!e) this.paused = true
71
+ if (this.$element.find('.next, .prev').length && $.support.transition.end) {
72
+ this.$element.trigger($.support.transition.end)
73
+ this.cycle()
74
+ }
71
75
  clearInterval(this.interval)
72
76
  this.interval = null
73
77
  return this
@@ -84,13 +88,15 @@
84
88
  }
85
89
 
86
90
  , slide: function (type, next) {
87
- var $active = this.$element.find('.active')
91
+ var $active = this.$element.find('.item.active')
88
92
  , $next = next || $active[type]()
89
93
  , isCycling = this.interval
90
94
  , direction = type == 'next' ? 'left' : 'right'
91
95
  , fallback = type == 'next' ? 'first' : 'last'
92
96
  , that = this
93
- , e = $.Event('slide')
97
+ , e = $.Event('slide', {
98
+ relatedTarget: $next[0]
99
+ })
94
100
 
95
101
  this.sliding = true
96
102
 
@@ -138,9 +144,10 @@
138
144
  var $this = $(this)
139
145
  , data = $this.data('carousel')
140
146
  , options = $.extend({}, $.fn.carousel.defaults, typeof option == 'object' && option)
147
+ , action = typeof option == 'string' ? option : options.slide
141
148
  if (!data) $this.data('carousel', (data = new Carousel(this, options)))
142
149
  if (typeof option == 'number') data.to(option)
143
- else if (typeof option == 'string' || (option = options.slide)) data[option]()
150
+ else if (action) data[action]()
144
151
  else if (options.interval) data.cycle()
145
152
  })
146
153
  }
@@ -1,5 +1,5 @@
1
1
  /* =============================================================
2
- * bootstrap-collapse.js v2.0.4
2
+ * bootstrap-collapse.js v2.1.1
3
3
  * http://twitter.github.com/bootstrap/javascript.html#collapse
4
4
  * =============================================================
5
5
  * Copyright 2012 Twitter, Inc.
@@ -67,7 +67,7 @@
67
67
 
68
68
  this.$element[dimension](0)
69
69
  this.transition('addClass', $.Event('show'), 'shown')
70
- this.$element[dimension](this.$element[0][scroll])
70
+ $.support.transition && this.$element[dimension](this.$element[0][scroll])
71
71
  }
72
72
 
73
73
  , hide: function () {
@@ -144,12 +144,13 @@
144
144
  * ==================== */
145
145
 
146
146
  $(function () {
147
- $('body').on('click.collapse.data-api', '[data-toggle=collapse]', function ( e ) {
147
+ $('body').on('click.collapse.data-api', '[data-toggle=collapse]', function (e) {
148
148
  var $this = $(this), href
149
149
  , target = $this.attr('data-target')
150
150
  || e.preventDefault()
151
151
  || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '') //strip for ie7
152
152
  , option = $(target).data('collapse') ? 'toggle' : $this.data()
153
+ $this[$(target).hasClass('in') ? 'addClass' : 'removeClass']('collapsed')
153
154
  $(target).collapse(option)
154
155
  })
155
156
  })
@@ -1,5 +1,5 @@
1
1
  /* ============================================================
2
- * bootstrap-dropdown.js v2.0.4
2
+ * bootstrap-dropdown.js v2.1.1
3
3
  * http://twitter.github.com/bootstrap/javascript.html#dropdowns
4
4
  * ============================================================
5
5
  * Copyright 2012 Twitter, Inc.
@@ -26,7 +26,7 @@
26
26
  /* DROPDOWN CLASS DEFINITION
27
27
  * ========================= */
28
28
 
29
- var toggle = '[data-toggle="dropdown"]'
29
+ var toggle = '[data-toggle=dropdown]'
30
30
  , Dropdown = function (element) {
31
31
  var $el = $(element).on('click.dropdown.data-api', this.toggle)
32
32
  $('html').on('click.dropdown.data-api', function () {
@@ -41,34 +41,82 @@
41
41
  , toggle: function (e) {
42
42
  var $this = $(this)
43
43
  , $parent
44
- , selector
45
44
  , isActive
46
45
 
47
46
  if ($this.is('.disabled, :disabled')) return
48
47
 
49
- selector = $this.attr('data-target')
48
+ $parent = getParent($this)
50
49
 
51
- if (!selector) {
52
- selector = $this.attr('href')
53
- selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7
50
+ isActive = $parent.hasClass('open')
51
+
52
+ clearMenus()
53
+
54
+ if (!isActive) {
55
+ $parent.toggleClass('open')
56
+ $this.focus()
54
57
  }
55
58
 
56
- $parent = $(selector)
57
- $parent.length || ($parent = $this.parent())
59
+ return false
60
+ }
61
+
62
+ , keydown: function (e) {
63
+ var $this
64
+ , $items
65
+ , $active
66
+ , $parent
67
+ , isActive
68
+ , index
69
+
70
+ if (!/(38|40|27)/.test(e.keyCode)) return
71
+
72
+ $this = $(this)
73
+
74
+ e.preventDefault()
75
+ e.stopPropagation()
76
+
77
+ if ($this.is('.disabled, :disabled')) return
78
+
79
+ $parent = getParent($this)
58
80
 
59
81
  isActive = $parent.hasClass('open')
60
82
 
61
- clearMenus()
83
+ if (!isActive || (isActive && e.keyCode == 27)) return $this.click()
62
84
 
63
- if (!isActive) $parent.toggleClass('open')
85
+ $items = $('[role=menu] li:not(.divider) a', $parent)
64
86
 
65
- return false
87
+ if (!$items.length) return
88
+
89
+ index = $items.index($items.filter(':focus'))
90
+
91
+ if (e.keyCode == 38 && index > 0) index-- // up
92
+ if (e.keyCode == 40 && index < $items.length - 1) index++ // down
93
+ if (!~index) index = 0
94
+
95
+ $items
96
+ .eq(index)
97
+ .focus()
66
98
  }
67
99
 
68
100
  }
69
101
 
70
102
  function clearMenus() {
71
- $(toggle).parent().removeClass('open')
103
+ getParent($(toggle))
104
+ .removeClass('open')
105
+ }
106
+
107
+ function getParent($this) {
108
+ var selector = $this.attr('data-target')
109
+ , $parent
110
+
111
+ if (!selector) {
112
+ selector = $this.attr('href')
113
+ selector = selector && /#/.test(selector) && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7
114
+ }
115
+
116
+ $parent = $(selector)
117
+ $parent.length || ($parent = $this.parent())
118
+
119
+ return $parent
72
120
  }
73
121
 
74
122
 
@@ -91,10 +139,12 @@
91
139
  * =================================== */
92
140
 
93
141
  $(function () {
94
- $('html').on('click.dropdown.data-api', clearMenus)
142
+ $('html')
143
+ .on('click.dropdown.data-api touchstart.dropdown.data-api', clearMenus)
95
144
  $('body')
96
- .on('click.dropdown', '.dropdown form', function (e) { e.stopPropagation() })
97
- .on('click.dropdown.data-api', toggle, Dropdown.prototype.toggle)
145
+ .on('click.dropdown touchstart.dropdown.data-api', '.dropdown form', function (e) { e.stopPropagation() })
146
+ .on('click.dropdown.data-api touchstart.dropdown.data-api' , toggle, Dropdown.prototype.toggle)
147
+ .on('keydown.dropdown.data-api touchstart.dropdown.data-api', toggle + ', [role=menu]' , Dropdown.prototype.keydown)
98
148
  })
99
149
 
100
150
  }(window.jQuery);
@@ -1,5 +1,5 @@
1
1
  /* =========================================================
2
- * bootstrap-modal.js v2.0.4
2
+ * bootstrap-modal.js v2.1.1
3
3
  * http://twitter.github.com/bootstrap/javascript.html#modals
4
4
  * =========================================================
5
5
  * Copyright 2012 Twitter, Inc.
@@ -26,10 +26,11 @@
26
26
  /* MODAL CLASS DEFINITION
27
27
  * ====================== */
28
28
 
29
- var Modal = function (content, options) {
29
+ var Modal = function (element, options) {
30
30
  this.options = options
31
- this.$element = $(content)
31
+ this.$element = $(element)
32
32
  .delegate('[data-dismiss="modal"]', 'click.dismiss.modal', $.proxy(this.hide, this))
33
+ this.options.remote && this.$element.find('.modal-body').load(this.options.remote)
33
34
  }
34
35
 
35
36
  Modal.prototype = {
@@ -52,8 +53,9 @@
52
53
 
53
54
  this.isShown = true
54
55
 
55
- escape.call(this)
56
- backdrop.call(this, function () {
56
+ this.escape()
57
+
58
+ this.backdrop(function () {
57
59
  var transition = $.support.transition && that.$element.hasClass('fade')
58
60
 
59
61
  if (!that.$element.parent().length) {
@@ -67,7 +69,12 @@
67
69
  that.$element[0].offsetWidth // force reflow
68
70
  }
69
71
 
70
- that.$element.addClass('in')
72
+ that.$element
73
+ .addClass('in')
74
+ .attr('aria-hidden', false)
75
+ .focus()
76
+
77
+ that.enforceFocus()
71
78
 
72
79
  transition ?
73
80
  that.$element.one($.support.transition.end, function () { that.$element.trigger('shown') }) :
@@ -91,90 +98,98 @@
91
98
 
92
99
  $('body').removeClass('modal-open')
93
100
 
94
- escape.call(this)
101
+ this.escape()
102
+
103
+ $(document).off('focusin.modal')
95
104
 
96
- this.$element.removeClass('in')
105
+ this.$element
106
+ .removeClass('in')
107
+ .attr('aria-hidden', true)
97
108
 
98
109
  $.support.transition && this.$element.hasClass('fade') ?
99
- hideWithTransition.call(this) :
100
- hideModal.call(this)
110
+ this.hideWithTransition() :
111
+ this.hideModal()
101
112
  }
102
113
 
103
- }
104
-
105
-
106
- /* MODAL PRIVATE METHODS
107
- * ===================== */
108
-
109
- function hideWithTransition() {
110
- var that = this
111
- , timeout = setTimeout(function () {
112
- that.$element.off($.support.transition.end)
113
- hideModal.call(that)
114
- }, 500)
114
+ , enforceFocus: function () {
115
+ var that = this
116
+ $(document).on('focusin.modal', function (e) {
117
+ if (that.$element[0] !== e.target && !that.$element.has(e.target).length) {
118
+ that.$element.focus()
119
+ }
120
+ })
121
+ }
115
122
 
116
- this.$element.one($.support.transition.end, function () {
117
- clearTimeout(timeout)
118
- hideModal.call(that)
119
- })
120
- }
123
+ , escape: function () {
124
+ var that = this
125
+ if (this.isShown && this.options.keyboard) {
126
+ this.$element.on('keyup.dismiss.modal', function ( e ) {
127
+ e.which == 27 && that.hide()
128
+ })
129
+ } else if (!this.isShown) {
130
+ this.$element.off('keyup.dismiss.modal')
131
+ }
132
+ }
121
133
 
122
- function hideModal(that) {
123
- this.$element
124
- .hide()
125
- .trigger('hidden')
134
+ , hideWithTransition: function () {
135
+ var that = this
136
+ , timeout = setTimeout(function () {
137
+ that.$element.off($.support.transition.end)
138
+ that.hideModal()
139
+ }, 500)
140
+
141
+ this.$element.one($.support.transition.end, function () {
142
+ clearTimeout(timeout)
143
+ that.hideModal()
144
+ })
145
+ }
126
146
 
127
- backdrop.call(this)
128
- }
147
+ , hideModal: function (that) {
148
+ this.$element
149
+ .hide()
150
+ .trigger('hidden')
129
151
 
130
- function backdrop(callback) {
131
- var that = this
132
- , animate = this.$element.hasClass('fade') ? 'fade' : ''
152
+ this.backdrop()
153
+ }
133
154
 
134
- if (this.isShown && this.options.backdrop) {
135
- var doAnimate = $.support.transition && animate
155
+ , removeBackdrop: function () {
156
+ this.$backdrop.remove()
157
+ this.$backdrop = null
158
+ }
136
159
 
137
- this.$backdrop = $('<div class="modal-backdrop ' + animate + '" />')
138
- .appendTo(document.body)
160
+ , backdrop: function (callback) {
161
+ var that = this
162
+ , animate = this.$element.hasClass('fade') ? 'fade' : ''
139
163
 
140
- if (this.options.backdrop != 'static') {
141
- this.$backdrop.click($.proxy(this.hide, this))
142
- }
164
+ if (this.isShown && this.options.backdrop) {
165
+ var doAnimate = $.support.transition && animate
143
166
 
144
- if (doAnimate) this.$backdrop[0].offsetWidth // force reflow
167
+ this.$backdrop = $('<div class="modal-backdrop ' + animate + '" />')
168
+ .appendTo(document.body)
145
169
 
146
- this.$backdrop.addClass('in')
170
+ if (this.options.backdrop != 'static') {
171
+ this.$backdrop.click($.proxy(this.hide, this))
172
+ }
147
173
 
148
- doAnimate ?
149
- this.$backdrop.one($.support.transition.end, callback) :
150
- callback()
174
+ if (doAnimate) this.$backdrop[0].offsetWidth // force reflow
151
175
 
152
- } else if (!this.isShown && this.$backdrop) {
153
- this.$backdrop.removeClass('in')
176
+ this.$backdrop.addClass('in')
154
177
 
155
- $.support.transition && this.$element.hasClass('fade')?
156
- this.$backdrop.one($.support.transition.end, $.proxy(removeBackdrop, this)) :
157
- removeBackdrop.call(this)
178
+ doAnimate ?
179
+ this.$backdrop.one($.support.transition.end, callback) :
180
+ callback()
158
181
 
159
- } else if (callback) {
160
- callback()
161
- }
162
- }
182
+ } else if (!this.isShown && this.$backdrop) {
183
+ this.$backdrop.removeClass('in')
163
184
 
164
- function removeBackdrop() {
165
- this.$backdrop.remove()
166
- this.$backdrop = null
167
- }
185
+ $.support.transition && this.$element.hasClass('fade')?
186
+ this.$backdrop.one($.support.transition.end, $.proxy(this.removeBackdrop, this)) :
187
+ this.removeBackdrop()
168
188
 
169
- function escape() {
170
- var that = this
171
- if (this.isShown && this.options.keyboard) {
172
- $(document).on('keyup.dismiss.modal', function ( e ) {
173
- e.which == 27 && that.hide()
174
- })
175
- } else if (!this.isShown) {
176
- $(document).off('keyup.dismiss.modal')
177
- }
189
+ } else if (callback) {
190
+ callback()
191
+ }
192
+ }
178
193
  }
179
194
 
180
195
 
@@ -206,12 +221,18 @@
206
221
 
207
222
  $(function () {
208
223
  $('body').on('click.modal.data-api', '[data-toggle="modal"]', function ( e ) {
209
- var $this = $(this), href
210
- , $target = $($this.attr('data-target') || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '')) //strip for ie7
211
- , option = $target.data('modal') ? 'toggle' : $.extend({}, $target.data(), $this.data())
224
+ var $this = $(this)
225
+ , href = $this.attr('href')
226
+ , $target = $($this.attr('data-target') || (href && href.replace(/.*(?=#[^\s]+$)/, ''))) //strip for ie7
227
+ , option = $target.data('modal') ? 'toggle' : $.extend({ remote: !/#/.test(href) && href }, $target.data(), $this.data())
212
228
 
213
229
  e.preventDefault()
214
- $target.modal(option)
230
+
231
+ $target
232
+ .modal(option)
233
+ .one('hide', function () {
234
+ $this.focus()
235
+ })
215
236
  })
216
237
  })
217
238