bootstrapped 1.0.1 → 2.0.3

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 (60) hide show
  1. data/.gitmodules +3 -0
  2. data/README.rdoc +7 -1
  3. data/bootstrapped.gemspec +1 -1
  4. data/lib/bootstrapped/engine.rb +1 -1
  5. data/lib/bootstrapped/version.rb +2 -1
  6. data/vendor/assets/javascripts/bootstrap-alert.js +28 -29
  7. data/vendor/assets/javascripts/bootstrap-button.js +32 -34
  8. data/vendor/assets/javascripts/bootstrap-carousel.js +34 -19
  9. data/vendor/assets/javascripts/bootstrap-collapse.js +47 -26
  10. data/vendor/assets/javascripts/bootstrap-dropdown.js +18 -10
  11. data/vendor/assets/javascripts/bootstrap-modal.js +26 -18
  12. data/vendor/assets/javascripts/bootstrap-popover.js +13 -10
  13. data/vendor/assets/javascripts/bootstrap-scrollspy.js +43 -17
  14. data/vendor/assets/javascripts/bootstrap-tab.js +12 -7
  15. data/vendor/assets/javascripts/bootstrap-tooltip.js +40 -35
  16. data/vendor/assets/javascripts/bootstrap-transition.js +31 -21
  17. data/vendor/assets/javascripts/bootstrap-typeahead.js +30 -16
  18. data/vendor/assets/stylesheets/twitter/bootstrap/static/bootstrap-responsive.css +808 -0
  19. data/vendor/assets/stylesheets/twitter/bootstrap/static/bootstrap.css +2314 -850
  20. data/vendor/less/twitter/bootstrap/less/accordion.less +5 -0
  21. data/vendor/less/twitter/bootstrap/less/alerts.less +2 -14
  22. data/vendor/less/twitter/bootstrap/less/bootstrap.less +2 -2
  23. data/vendor/less/twitter/bootstrap/less/breadcrumbs.less +3 -1
  24. data/vendor/less/twitter/bootstrap/less/button-groups.less +78 -34
  25. data/vendor/less/twitter/bootstrap/less/buttons.less +53 -27
  26. data/vendor/less/twitter/bootstrap/less/carousel.less +0 -0
  27. data/vendor/less/twitter/bootstrap/less/close.less +12 -1
  28. data/vendor/less/twitter/bootstrap/less/code.less +18 -5
  29. data/vendor/less/twitter/bootstrap/less/component-animations.less +9 -7
  30. data/vendor/less/twitter/bootstrap/less/dropdowns.less +59 -47
  31. data/vendor/less/twitter/bootstrap/less/forms.less +167 -98
  32. data/vendor/less/twitter/bootstrap/less/grid.less +2 -5
  33. data/vendor/less/twitter/bootstrap/less/hero-unit.less +3 -1
  34. data/vendor/less/twitter/bootstrap/less/labels-badges.less +55 -0
  35. data/vendor/less/twitter/bootstrap/less/layouts.less +1 -1
  36. data/vendor/less/twitter/bootstrap/less/mixins.less +261 -167
  37. data/vendor/less/twitter/bootstrap/less/modals.less +22 -4
  38. data/vendor/less/twitter/bootstrap/less/navbar.less +147 -75
  39. data/vendor/less/twitter/bootstrap/less/navs.less +72 -53
  40. data/vendor/less/twitter/bootstrap/less/pager.less +6 -0
  41. data/vendor/less/twitter/bootstrap/less/pagination.less +1 -0
  42. data/vendor/less/twitter/bootstrap/less/popovers.less +0 -0
  43. data/vendor/less/twitter/bootstrap/less/progress-bars.less +27 -5
  44. data/vendor/less/twitter/bootstrap/less/reset.less +4 -4
  45. data/vendor/less/twitter/bootstrap/less/responsive-1200px-min.less +26 -0
  46. data/vendor/less/twitter/bootstrap/less/responsive-767px-max.less +149 -0
  47. data/vendor/less/twitter/bootstrap/less/responsive-768px-979px.less +17 -0
  48. data/vendor/less/twitter/bootstrap/less/responsive-navbar.less +146 -0
  49. data/vendor/less/twitter/bootstrap/less/responsive-utilities.less +41 -0
  50. data/vendor/less/twitter/bootstrap/less/responsive.less +14 -289
  51. data/vendor/less/twitter/bootstrap/less/scaffolding.less +4 -4
  52. data/vendor/less/twitter/bootstrap/less/sprites.less +47 -12
  53. data/vendor/less/twitter/bootstrap/less/tables.less +59 -22
  54. data/vendor/less/twitter/bootstrap/less/thumbnails.less +15 -3
  55. data/vendor/less/twitter/bootstrap/less/tooltip.less +0 -0
  56. data/vendor/less/twitter/bootstrap/less/type.less +30 -12
  57. data/vendor/less/twitter/bootstrap/less/utilities.less +0 -0
  58. data/vendor/less/twitter/bootstrap/less/variables.less +119 -13
  59. data/vendor/less/twitter/bootstrap/less/wells.less +10 -0
  60. metadata +30 -22
data/.gitmodules ADDED
@@ -0,0 +1,3 @@
1
+ [submodule "vendor/assets/externals/Font-Awesome"]
2
+ path = vendor/assets/externals/Font-Awesome
3
+ url = https://github.com/entropillc/Font-Awesome.git
data/README.rdoc CHANGED
@@ -47,7 +47,7 @@ You can change the name of the layout by specifying the layout name. For example
47
47
 
48
48
  You can also specify if you want a fixed for fluid layout. If you choose to specify the layout, you must specify the layout name as well. The options are fluid and fixed
49
49
 
50
- rails g boostrapped:layout [layout_name] [fixed or fluid]
50
+ rails g bootstrapped:layout [layout_name] [fixed or fluid]
51
51
 
52
52
  An example command:
53
53
 
@@ -72,6 +72,12 @@ http://github.com/entropillc/bootstrapped/issues
72
72
 
73
73
  == Change Log
74
74
 
75
+ === Version 2.0.3
76
+
77
+ * Updated Twitter Bootstrap to 2.0.3
78
+ * Updated versioning to match Bootstrap for better tracking
79
+ * Updated version file to contain variable for Bootstrap Version
80
+
75
81
  === Version 1.0.1
76
82
 
77
83
  * Added HAML support in scaffolding
data/bootstrapped.gemspec CHANGED
@@ -4,7 +4,7 @@ require "bootstrapped/version"
4
4
 
5
5
  Gem::Specification.new do |s|
6
6
  s.name = "bootstrapped"
7
- s.version ='1.0.1'
7
+ s.version = Bootstrapped::VERSION
8
8
  s.authors = ["Nicholas Watson"]
9
9
  s.email = ["nwwatson@gmail.com"]
10
10
  s.homepage = "http://github.com/entropillc/bootstrapped"
@@ -7,7 +7,7 @@ module Bootstrapped
7
7
  initializer 'twitter-bootstrap-rails.setup',
8
8
  :after => 'less-rails.after.load_config_initializers',
9
9
  :group => :all do |app|
10
- app.config.less.paths << File.join(config.root, 'vendor', 'less',)
10
+ app.config.less.paths << File.join(config.root, 'vendor', 'less')
11
11
  end
12
12
  end
13
13
  end
@@ -1,3 +1,4 @@
1
1
  module Bootstrapped
2
- VERSION = "1.0.1"
2
+ VERSION = "2.0.3"
3
+ BOOTSTRAP_VERSION = "2.0.3"
3
4
  end
@@ -1,5 +1,5 @@
1
1
  /* ==========================================================
2
- * bootstrap-alert.js v2.0.0
2
+ * bootstrap-alert.js v2.0.3
3
3
  * http://twitter.github.com/bootstrap/javascript.html#alerts
4
4
  * ==========================================================
5
5
  * Copyright 2012 Twitter, Inc.
@@ -18,58 +18,57 @@
18
18
  * ========================================================== */
19
19
 
20
20
 
21
- !function( $ ){
21
+ !function ($) {
22
+
23
+ "use strict"; // jshint ;_;
22
24
 
23
- "use strict"
24
25
 
25
26
  /* ALERT CLASS DEFINITION
26
27
  * ====================== */
27
28
 
28
29
  var dismiss = '[data-dismiss="alert"]'
29
- , Alert = function ( el ) {
30
+ , Alert = function (el) {
30
31
  $(el).on('click', dismiss, this.close)
31
32
  }
32
33
 
33
- Alert.prototype = {
34
-
35
- constructor: Alert
34
+ Alert.prototype.close = function (e) {
35
+ var $this = $(this)
36
+ , selector = $this.attr('data-target')
37
+ , $parent
36
38
 
37
- , close: function ( e ) {
38
- var $this = $(this)
39
- , selector = $this.attr('data-target')
40
- , $parent
39
+ if (!selector) {
40
+ selector = $this.attr('href')
41
+ selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7
42
+ }
41
43
 
42
- if (!selector) {
43
- selector = $this.attr('href')
44
- selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7
45
- }
44
+ $parent = $(selector)
46
45
 
47
- $parent = $(selector)
48
- $parent.trigger('close')
46
+ e && e.preventDefault()
49
47
 
50
- e && e.preventDefault()
48
+ $parent.length || ($parent = $this.hasClass('alert') ? $this : $this.parent())
51
49
 
52
- $parent.length || ($parent = $this.hasClass('alert') ? $this : $this.parent())
50
+ $parent.trigger(e = $.Event('close'))
53
51
 
54
- $parent.removeClass('in')
52
+ if (e.isDefaultPrevented()) return
55
53
 
56
- function removeElement() {
57
- $parent.remove()
58
- $parent.trigger('closed')
59
- }
54
+ $parent.removeClass('in')
60
55
 
61
- $.support.transition && $parent.hasClass('fade') ?
62
- $parent.on($.support.transition.end, removeElement) :
63
- removeElement()
56
+ function removeElement() {
57
+ $parent
58
+ .trigger('closed')
59
+ .remove()
64
60
  }
65
61
 
62
+ $.support.transition && $parent.hasClass('fade') ?
63
+ $parent.on($.support.transition.end, removeElement) :
64
+ removeElement()
66
65
  }
67
66
 
68
67
 
69
68
  /* ALERT PLUGIN DEFINITION
70
69
  * ======================= */
71
70
 
72
- $.fn.alert = function ( option ) {
71
+ $.fn.alert = function (option) {
73
72
  return this.each(function () {
74
73
  var $this = $(this)
75
74
  , data = $this.data('alert')
@@ -88,4 +87,4 @@
88
87
  $('body').on('click.alert.data-api', dismiss, Alert.prototype.close)
89
88
  })
90
89
 
91
- }( window.jQuery )
90
+ }(window.jQuery);
@@ -1,5 +1,5 @@
1
1
  /* ============================================================
2
- * bootstrap-button.js v2.0.0
2
+ * bootstrap-button.js v2.0.3
3
3
  * http://twitter.github.com/bootstrap/javascript.html#buttons
4
4
  * ============================================================
5
5
  * Copyright 2012 Twitter, Inc.
@@ -17,58 +17,54 @@
17
17
  * limitations under the License.
18
18
  * ============================================================ */
19
19
 
20
- !function( $ ){
21
20
 
22
- "use strict"
21
+ !function ($) {
22
+
23
+ "use strict"; // jshint ;_;
24
+
23
25
 
24
26
  /* BUTTON PUBLIC CLASS DEFINITION
25
27
  * ============================== */
26
28
 
27
- var Button = function ( element, options ) {
29
+ var Button = function (element, options) {
28
30
  this.$element = $(element)
29
31
  this.options = $.extend({}, $.fn.button.defaults, options)
30
32
  }
31
33
 
32
- Button.prototype = {
33
-
34
- constructor: Button
34
+ Button.prototype.setState = function (state) {
35
+ var d = 'disabled'
36
+ , $el = this.$element
37
+ , data = $el.data()
38
+ , val = $el.is('input') ? 'val' : 'html'
35
39
 
36
- , setState: function ( state ) {
37
- var d = 'disabled'
38
- , $el = this.$element
39
- , data = $el.data()
40
- , val = $el.is('input') ? 'val' : 'html'
40
+ state = state + 'Text'
41
+ data.resetText || $el.data('resetText', $el[val]())
41
42
 
42
- state = state + 'Text'
43
- data.resetText || $el.data('resetText', $el[val]())
43
+ $el[val](data[state] || this.options[state])
44
44
 
45
- $el[val](data[state] || this.options[state])
46
-
47
- // push to event loop to allow forms to submit
48
- setTimeout(function () {
49
- state == 'loadingText' ?
50
- $el.addClass(d).attr(d, d) :
51
- $el.removeClass(d).removeAttr(d)
52
- }, 0)
53
- }
54
-
55
- , toggle: function () {
56
- var $parent = this.$element.parent('[data-toggle="buttons-radio"]')
45
+ // push to event loop to allow forms to submit
46
+ setTimeout(function () {
47
+ state == 'loadingText' ?
48
+ $el.addClass(d).attr(d, d) :
49
+ $el.removeClass(d).removeAttr(d)
50
+ }, 0)
51
+ }
57
52
 
58
- $parent && $parent
59
- .find('.active')
60
- .removeClass('active')
53
+ Button.prototype.toggle = function () {
54
+ var $parent = this.$element.parent('[data-toggle="buttons-radio"]')
61
55
 
62
- this.$element.toggleClass('active')
63
- }
56
+ $parent && $parent
57
+ .find('.active')
58
+ .removeClass('active')
64
59
 
60
+ this.$element.toggleClass('active')
65
61
  }
66
62
 
67
63
 
68
64
  /* BUTTON PLUGIN DEFINITION
69
65
  * ======================== */
70
66
 
71
- $.fn.button = function ( option ) {
67
+ $.fn.button = function (option) {
72
68
  return this.each(function () {
73
69
  var $this = $(this)
74
70
  , data = $this.data('button')
@@ -91,8 +87,10 @@
91
87
 
92
88
  $(function () {
93
89
  $('body').on('click.button.data-api', '[data-toggle^=button]', function ( e ) {
94
- $(e.target).button('toggle')
90
+ var $btn = $(e.target)
91
+ if (!$btn.hasClass('btn')) $btn = $btn.closest('.btn')
92
+ $btn.button('toggle')
95
93
  })
96
94
  })
97
95
 
98
- }( window.jQuery )
96
+ }(window.jQuery);
@@ -1,5 +1,5 @@
1
1
  /* ==========================================================
2
- * bootstrap-carousel.js v2.0.0
2
+ * bootstrap-carousel.js v2.0.3
3
3
  * http://twitter.github.com/bootstrap/javascript.html#carousel
4
4
  * ==========================================================
5
5
  * Copyright 2012 Twitter, Inc.
@@ -18,23 +18,30 @@
18
18
  * ========================================================== */
19
19
 
20
20
 
21
- !function( $ ){
21
+ !function ($) {
22
+
23
+ "use strict"; // jshint ;_;
22
24
 
23
- "use strict"
24
25
 
25
26
  /* CAROUSEL CLASS DEFINITION
26
27
  * ========================= */
27
28
 
28
29
  var Carousel = function (element, options) {
29
30
  this.$element = $(element)
30
- this.options = $.extend({}, $.fn.carousel.defaults, options)
31
+ this.options = options
31
32
  this.options.slide && this.slide(this.options.slide)
33
+ this.options.pause == 'hover' && this.$element
34
+ .on('mouseenter', $.proxy(this.pause, this))
35
+ .on('mouseleave', $.proxy(this.cycle, this))
32
36
  }
33
37
 
34
38
  Carousel.prototype = {
35
39
 
36
- cycle: function () {
37
- this.interval = setInterval($.proxy(this.next, this), this.options.interval)
40
+ cycle: function (e) {
41
+ if (!e) this.paused = false
42
+ this.options.interval
43
+ && !this.paused
44
+ && (this.interval = setInterval($.proxy(this.next, this), this.options.interval))
38
45
  return this
39
46
  }
40
47
 
@@ -59,8 +66,10 @@
59
66
  return this.slide(pos > activePos ? 'next' : 'prev', $(children[pos]))
60
67
  }
61
68
 
62
- , pause: function () {
69
+ , pause: function (e) {
70
+ if (!e) this.paused = true
63
71
  clearInterval(this.interval)
72
+ this.interval = null
64
73
  return this
65
74
  }
66
75
 
@@ -81,6 +90,7 @@
81
90
  , direction = type == 'next' ? 'left' : 'right'
82
91
  , fallback = type == 'next' ? 'first' : 'last'
83
92
  , that = this
93
+ , e = $.Event('slide')
84
94
 
85
95
  this.sliding = true
86
96
 
@@ -88,24 +98,28 @@
88
98
 
89
99
  $next = $next.length ? $next : this.$element.find('.item')[fallback]()
90
100
 
91
- if (!$.support.transition && this.$element.hasClass('slide')) {
92
- this.$element.trigger('slide')
93
- $active.removeClass('active')
94
- $next.addClass('active')
95
- this.sliding = false
96
- this.$element.trigger('slid')
97
- } else {
101
+ if ($next.hasClass('active')) return
102
+
103
+ if ($.support.transition && this.$element.hasClass('slide')) {
104
+ this.$element.trigger(e)
105
+ if (e.isDefaultPrevented()) return
98
106
  $next.addClass(type)
99
107
  $next[0].offsetWidth // force reflow
100
108
  $active.addClass(direction)
101
109
  $next.addClass(direction)
102
- this.$element.trigger('slide')
103
110
  this.$element.one($.support.transition.end, function () {
104
111
  $next.removeClass([type, direction].join(' ')).addClass('active')
105
112
  $active.removeClass(['active', direction].join(' '))
106
113
  that.sliding = false
107
114
  setTimeout(function () { that.$element.trigger('slid') }, 0)
108
115
  })
116
+ } else {
117
+ this.$element.trigger(e)
118
+ if (e.isDefaultPrevented()) return
119
+ $active.removeClass('active')
120
+ $next.addClass('active')
121
+ this.sliding = false
122
+ this.$element.trigger('slid')
109
123
  }
110
124
 
111
125
  isCycling && this.cycle()
@@ -119,20 +133,21 @@
119
133
  /* CAROUSEL PLUGIN DEFINITION
120
134
  * ========================== */
121
135
 
122
- $.fn.carousel = function ( option ) {
136
+ $.fn.carousel = function (option) {
123
137
  return this.each(function () {
124
138
  var $this = $(this)
125
139
  , data = $this.data('carousel')
126
- , options = typeof option == 'object' && option
140
+ , options = $.extend({}, $.fn.carousel.defaults, typeof option == 'object' && option)
127
141
  if (!data) $this.data('carousel', (data = new Carousel(this, options)))
128
142
  if (typeof option == 'number') data.to(option)
129
143
  else if (typeof option == 'string' || (option = options.slide)) data[option]()
130
- else data.cycle()
144
+ else if (options.interval) data.cycle()
131
145
  })
132
146
  }
133
147
 
134
148
  $.fn.carousel.defaults = {
135
149
  interval: 5000
150
+ , pause: 'hover'
136
151
  }
137
152
 
138
153
  $.fn.carousel.Constructor = Carousel
@@ -151,4 +166,4 @@
151
166
  })
152
167
  })
153
168
 
154
- }( window.jQuery )
169
+ }(window.jQuery);
@@ -1,5 +1,5 @@
1
1
  /* =============================================================
2
- * bootstrap-collapse.js v2.0.0
2
+ * bootstrap-collapse.js v2.0.3
3
3
  * http://twitter.github.com/bootstrap/javascript.html#collapse
4
4
  * =============================================================
5
5
  * Copyright 2012 Twitter, Inc.
@@ -17,16 +17,21 @@
17
17
  * limitations under the License.
18
18
  * ============================================================ */
19
19
 
20
- !function( $ ){
21
20
 
22
- "use strict"
21
+ !function ($) {
23
22
 
24
- var Collapse = function ( element, options ) {
25
- this.$element = $(element)
23
+ "use strict"; // jshint ;_;
24
+
25
+
26
+ /* COLLAPSE PUBLIC CLASS DEFINITION
27
+ * ================================ */
28
+
29
+ var Collapse = function (element, options) {
30
+ this.$element = $(element)
26
31
  this.options = $.extend({}, $.fn.collapse.defaults, options)
27
32
 
28
- if (this.options["parent"]) {
29
- this.$parent = $(this.options["parent"])
33
+ if (this.options.parent) {
34
+ this.$parent = $(this.options.parent)
30
35
  }
31
36
 
32
37
  this.options.toggle && this.toggle()
@@ -42,31 +47,39 @@
42
47
  }
43
48
 
44
49
  , show: function () {
45
- var dimension = this.dimension()
46
- , scroll = $.camelCase(['scroll', dimension].join('-'))
47
- , actives = this.$parent && this.$parent.find('.in')
50
+ var dimension
51
+ , scroll
52
+ , actives
48
53
  , hasData
49
54
 
55
+ if (this.transitioning) return
56
+
57
+ dimension = this.dimension()
58
+ scroll = $.camelCase(['scroll', dimension].join('-'))
59
+ actives = this.$parent && this.$parent.find('> .accordion-group > .in')
60
+
50
61
  if (actives && actives.length) {
51
62
  hasData = actives.data('collapse')
63
+ if (hasData && hasData.transitioning) return
52
64
  actives.collapse('hide')
53
65
  hasData || actives.data('collapse', null)
54
66
  }
55
67
 
56
68
  this.$element[dimension](0)
57
- this.transition('addClass', 'show', 'shown')
69
+ this.transition('addClass', $.Event('show'), 'shown')
58
70
  this.$element[dimension](this.$element[0][scroll])
59
-
60
71
  }
61
72
 
62
73
  , hide: function () {
63
- var dimension = this.dimension()
74
+ var dimension
75
+ if (this.transitioning) return
76
+ dimension = this.dimension()
64
77
  this.reset(this.$element[dimension]())
65
- this.transition('removeClass', 'hide', 'hidden')
78
+ this.transition('removeClass', $.Event('hide'), 'hidden')
66
79
  this.$element[dimension](0)
67
80
  }
68
81
 
69
- , reset: function ( size ) {
82
+ , reset: function (size) {
70
83
  var dimension = this.dimension()
71
84
 
72
85
  this.$element
@@ -74,35 +87,43 @@
74
87
  [dimension](size || 'auto')
75
88
  [0].offsetWidth
76
89
 
77
- this.$element.addClass('collapse')
90
+ this.$element[size !== null ? 'addClass' : 'removeClass']('collapse')
91
+
92
+ return this
78
93
  }
79
94
 
80
- , transition: function ( method, startEvent, completeEvent ) {
95
+ , transition: function (method, startEvent, completeEvent) {
81
96
  var that = this
82
97
  , complete = function () {
83
- if (startEvent == 'show') that.reset()
98
+ if (startEvent.type == 'show') that.reset()
99
+ that.transitioning = 0
84
100
  that.$element.trigger(completeEvent)
85
101
  }
86
102
 
87
- this.$element
88
- .trigger(startEvent)
89
- [method]('in')
103
+ this.$element.trigger(startEvent)
104
+
105
+ if (startEvent.isDefaultPrevented()) return
106
+
107
+ this.transitioning = 1
108
+
109
+ this.$element[method]('in')
90
110
 
91
111
  $.support.transition && this.$element.hasClass('collapse') ?
92
112
  this.$element.one($.support.transition.end, complete) :
93
113
  complete()
94
- }
114
+ }
95
115
 
96
116
  , toggle: function () {
97
117
  this[this.$element.hasClass('in') ? 'hide' : 'show']()
98
- }
118
+ }
99
119
 
100
120
  }
101
121
 
102
- /* COLLAPSIBLE PLUGIN DEFINITION
122
+
123
+ /* COLLAPSIBLE PLUGIN DEFINITION
103
124
  * ============================== */
104
125
 
105
- $.fn.collapse = function ( option ) {
126
+ $.fn.collapse = function (option) {
106
127
  return this.each(function () {
107
128
  var $this = $(this)
108
129
  , data = $this.data('collapse')
@@ -133,4 +154,4 @@
133
154
  })
134
155
  })
135
156
 
136
- }( window.jQuery )
157
+ }(window.jQuery);
@@ -1,5 +1,5 @@
1
1
  /* ============================================================
2
- * bootstrap-dropdown.js v2.0.0
2
+ * bootstrap-dropdown.js v2.0.3
3
3
  * http://twitter.github.com/bootstrap/javascript.html#dropdowns
4
4
  * ============================================================
5
5
  * Copyright 2012 Twitter, Inc.
@@ -18,15 +18,16 @@
18
18
  * ============================================================ */
19
19
 
20
20
 
21
- !function( $ ){
21
+ !function ($) {
22
+
23
+ "use strict"; // jshint ;_;
22
24
 
23
- "use strict"
24
25
 
25
26
  /* DROPDOWN CLASS DEFINITION
26
27
  * ========================= */
27
28
 
28
29
  var toggle = '[data-toggle="dropdown"]'
29
- , Dropdown = function ( element ) {
30
+ , Dropdown = function (element) {
30
31
  var $el = $(element).on('click.dropdown.data-api', this.toggle)
31
32
  $('html').on('click.dropdown.data-api', function () {
32
33
  $el.parent().removeClass('open')
@@ -37,12 +38,16 @@
37
38
 
38
39
  constructor: Dropdown
39
40
 
40
- , toggle: function ( e ) {
41
+ , toggle: function (e) {
41
42
  var $this = $(this)
42
- , selector = $this.attr('data-target')
43
43
  , $parent
44
+ , selector
44
45
  , isActive
45
46
 
47
+ if ($this.is('.disabled, :disabled')) return
48
+
49
+ selector = $this.attr('data-target')
50
+
46
51
  if (!selector) {
47
52
  selector = $this.attr('href')
48
53
  selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7
@@ -54,7 +59,8 @@
54
59
  isActive = $parent.hasClass('open')
55
60
 
56
61
  clearMenus()
57
- !isActive && $parent.toggleClass('open')
62
+
63
+ if (!isActive) $parent.toggleClass('open')
58
64
 
59
65
  return false
60
66
  }
@@ -69,7 +75,7 @@
69
75
  /* DROPDOWN PLUGIN DEFINITION
70
76
  * ========================== */
71
77
 
72
- $.fn.dropdown = function ( option ) {
78
+ $.fn.dropdown = function (option) {
73
79
  return this.each(function () {
74
80
  var $this = $(this)
75
81
  , data = $this.data('dropdown')
@@ -86,7 +92,9 @@
86
92
 
87
93
  $(function () {
88
94
  $('html').on('click.dropdown.data-api', clearMenus)
89
- $('body').on('click.dropdown.data-api', toggle, Dropdown.prototype.toggle)
95
+ $('body')
96
+ .on('click.dropdown', '.dropdown form', function (e) { e.stopPropagation() })
97
+ .on('click.dropdown.data-api', toggle, Dropdown.prototype.toggle)
90
98
  })
91
99
 
92
- }( window.jQuery )
100
+ }(window.jQuery);