bootstrap-sass 1.3.1 → 1.3.2

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of bootstrap-sass might be problematic. Click here for more details.

data/README.md CHANGED
@@ -30,10 +30,16 @@ In your Javascript manifest:
30
30
  // Loads all Bootstrap javascripts
31
31
  //= require bootstrap
32
32
 
33
- // Alternatively
33
+ // Alternatively, load individual modules
34
34
  //= require bootstrap-scrollspy
35
35
  //= require bootstrap-modal
36
36
  //= require bootstrap-dropdown
37
37
 
38
38
  Simples.
39
39
 
40
+ ## Versioning
41
+ We try to stick to Bootstrap versioning wherever possible. The major and minor version numbers will always represent the Twitter Bootstrap version, but no guarantees are made for the tiny version number, since waiting for Bootstrap to update so I can push out a fix sucks.
42
+
43
+ ## Branches
44
+ Master will usually represent the latest release of `bootstrap-sass`. Other branches contain experimental code, or are a relatively close mirror of other Bootstrap branches.
45
+
@@ -1,3 +1,5 @@
1
+ require 'sass-rails'
2
+
1
3
  module Bootstrap
2
4
  module Rails
3
5
  class Engine < ::Rails::Engine
@@ -18,7 +18,7 @@
18
18
  * ========================================================== */
19
19
 
20
20
 
21
- (function( $ ){
21
+ !function( $ ){
22
22
 
23
23
  /* CSS TRANSITION SUPPORT (https://gist.github.com/373874)
24
24
  * ======================================================= */
@@ -51,9 +51,10 @@
51
51
  /* ALERT CLASS DEFINITION
52
52
  * ====================== */
53
53
 
54
- var Alert = function ( content, selector ) {
54
+ var Alert = function ( content, options ) {
55
+ this.settings = $.extend({}, $.fn.alert.defaults, options)
55
56
  this.$element = $(content)
56
- .delegate(selector || '.close', 'click', this.close)
57
+ .delegate(this.settings.selector, 'click', this.close)
57
58
  }
58
59
 
59
60
  Alert.prototype = {
@@ -92,14 +93,19 @@
92
93
  return $this.data('alert')[options]()
93
94
  }
94
95
 
95
- $(this).data('alert', new Alert( this ))
96
+ $(this).data('alert', new Alert( this, options ))
96
97
 
97
98
  })
98
99
  }
99
100
 
101
+ $.fn.alert.defaults = {
102
+ selector: '.close'
103
+ }
104
+
100
105
  $(document).ready(function () {
101
- new Alert($('body'), '.alert-message[data-alert] .close')
106
+ new Alert($('body'), {
107
+ selector: '.alert-message[data-alert] .close'
108
+ })
102
109
  })
103
110
 
104
- })( window.jQuery || window.ender )
105
-
111
+ }( window.jQuery || window.ender );
@@ -18,18 +18,7 @@
18
18
  * ============================================================ */
19
19
 
20
20
 
21
- (function( $ ){
22
-
23
- var d = 'a.menu, .dropdown-toggle'
24
-
25
- function clearMenus() {
26
- $(d).parent('li').removeClass('open')
27
- }
28
-
29
- $(function () {
30
- $('html').bind("click", clearMenus)
31
- $('body').dropdown( '[data-dropdown] a.menu, [data-dropdown] .dropdown-toggle' )
32
- })
21
+ !function( $ ){
33
22
 
34
23
  /* DROPDOWN PLUGIN DEFINITION
35
24
  * ========================== */
@@ -47,5 +36,18 @@
47
36
  })
48
37
  }
49
38
 
50
- })( window.jQuery || window.ender )
39
+ /* APPLY TO STANDARD DROPDOWN ELEMENTS
40
+ * =================================== */
41
+
42
+ var d = 'a.menu, .dropdown-toggle'
43
+
44
+ function clearMenus() {
45
+ $(d).parent('li').removeClass('open')
46
+ }
47
+
48
+ $(function () {
49
+ $('html').bind("click", clearMenus)
50
+ $('body').dropdown( '[data-dropdown] a.menu, [data-dropdown] .dropdown-toggle' )
51
+ })
51
52
 
53
+ }( window.jQuery || window.ender );
@@ -18,7 +18,7 @@
18
18
  * ========================================================= */
19
19
 
20
20
 
21
- (function( $ ){
21
+ !function( $ ){
22
22
 
23
23
  /* CSS TRANSITION SUPPORT (https://gist.github.com/373874)
24
24
  * ======================================================= */
@@ -53,16 +53,12 @@
53
53
  * ============================= */
54
54
 
55
55
  var Modal = function ( content, options ) {
56
- this.settings = $.extend({}, $.fn.modal.defaults)
56
+ this.settings = $.extend({}, $.fn.modal.defaults, options)
57
57
  this.$element = $(content)
58
58
  .delegate('.close', 'click.modal', $.proxy(this.hide, this))
59
59
 
60
- if ( options ) {
61
- $.extend( this.settings, options )
62
-
63
- if ( options.show ) {
64
- this.show()
65
- }
60
+ if ( this.settings.show ) {
61
+ this.show()
66
62
  }
67
63
 
68
64
  return this
@@ -81,15 +77,23 @@
81
77
 
82
78
  escape.call(this)
83
79
  backdrop.call(this, function () {
80
+ var transition = $.support.transition && that.$element.hasClass('fade')
81
+
84
82
  that.$element
85
83
  .appendTo(document.body)
86
84
  .show()
87
85
 
88
- setTimeout(function () {
89
- that.$element
90
- .addClass('in')
91
- .trigger('shown')
92
- }, 0)
86
+ if (transition) {
87
+ that.$element[0].offsetWidth // force reflow
88
+ }
89
+
90
+ that.$element
91
+ .addClass('in')
92
+
93
+ transition ?
94
+ that.$element.one(transitionEnd, function () { that.$element.trigger('shown') }) :
95
+ that.$element.trigger('shown')
96
+
93
97
  })
94
98
 
95
99
  return this
@@ -98,6 +102,10 @@
98
102
  , hide: function (e) {
99
103
  e && e.preventDefault()
100
104
 
105
+ if ( !this.isShown ) {
106
+ return this
107
+ }
108
+
101
109
  var that = this
102
110
  this.isShown = false
103
111
 
@@ -132,6 +140,8 @@
132
140
  var that = this
133
141
  , animate = this.$element.hasClass('fade') ? 'fade' : ''
134
142
  if ( this.isShown && this.settings.backdrop ) {
143
+ var doAnimate = $.support.transition && animate
144
+
135
145
  this.$backdrop = $('<div class="modal-backdrop ' + animate + '" />')
136
146
  .appendTo(document.body)
137
147
 
@@ -139,12 +149,15 @@
139
149
  this.$backdrop.click($.proxy(this.hide, this))
140
150
  }
141
151
 
142
- setTimeout(function () {
143
- that.$backdrop && that.$backdrop.addClass('in')
144
- $.support.transition && that.$backdrop.hasClass('fade') ?
145
- that.$backdrop.one(transitionEnd, callback) :
146
- callback()
147
- }, 0)
152
+ if ( doAnimate ) {
153
+ this.$backdrop[0].offsetWidth // force reflow
154
+ }
155
+
156
+ this.$backdrop.addClass('in')
157
+
158
+ doAnimate ?
159
+ this.$backdrop.one(transitionEnd, callback) :
160
+ callback()
148
161
 
149
162
  } else if ( !this.isShown && this.$backdrop ) {
150
163
  this.$backdrop.removeClass('in')
@@ -165,13 +178,13 @@
165
178
  function escape() {
166
179
  var that = this
167
180
  if ( this.isShown && this.settings.keyboard ) {
168
- $('body').bind('keyup.modal', function ( e ) {
181
+ $(document).bind('keyup.modal', function ( e ) {
169
182
  if ( e.which == 27 ) {
170
183
  that.hide()
171
184
  }
172
185
  })
173
186
  } else if ( !this.isShown ) {
174
- $('body').unbind('keyup.modal')
187
+ $(document).unbind('keyup.modal')
175
188
  }
176
189
  }
177
190
 
@@ -213,7 +226,7 @@
213
226
  $.fn.modal.defaults = {
214
227
  backdrop: false
215
228
  , keyboard: false
216
- , show: true
229
+ , show: false
217
230
  }
218
231
 
219
232
 
@@ -228,5 +241,4 @@
228
241
  })
229
242
  })
230
243
 
231
- })( window.jQuery || window.ender )
232
-
244
+ }( window.jQuery || window.ender );
@@ -18,7 +18,7 @@
18
18
  * =========================================================== */
19
19
 
20
20
 
21
- (function( $ ) {
21
+ !function( $ ) {
22
22
 
23
23
  var Popover = function ( element, options ) {
24
24
  this.$element = $(element)
@@ -40,7 +40,7 @@
40
40
  }
41
41
 
42
42
  , getContent: function () {
43
- var contentvar
43
+ var content
44
44
  , $e = this.$element
45
45
  , o = this.options
46
46
 
@@ -74,5 +74,4 @@
74
74
 
75
75
  $.fn.popover.defaults = $.extend({} , $.fn.twipsy.defaults, { content: 'data-content', placement: 'right'})
76
76
 
77
- })( window.jQuery || window.ender )
78
-
77
+ }( window.jQuery || window.ender );
@@ -102,5 +102,4 @@
102
102
  $('body').scrollSpy('[data-scrollspy] li > a')
103
103
  })
104
104
 
105
- }( window.jQuery || window.ender )
106
-
105
+ }( window.jQuery || window.ender );
@@ -18,30 +18,45 @@
18
18
  * ======================================================== */
19
19
 
20
20
 
21
- (function( $ ){
21
+ !function( $ ){
22
22
 
23
23
  function activate ( element, container ) {
24
- container.find('.active').removeClass('active')
24
+ container
25
+ .find('> .active')
26
+ .removeClass('active')
27
+ .find('> .dropdown-menu > .active')
28
+ .removeClass('active')
29
+
25
30
  element.addClass('active')
31
+
32
+ if ( element.parent('.dropdown-menu') ) {
33
+ element.closest('li.dropdown').addClass('active')
34
+ }
26
35
  }
27
36
 
28
37
  function tab( e ) {
29
38
  var $this = $(this)
39
+ , $ul = $this.closest('ul:not(.dropdown-menu)')
30
40
  , href = $this.attr('href')
31
- , $ul = $(e.liveFired)
32
- , $controlled
41
+ , previous
33
42
 
34
- if (/^#\w+/.test(href)) {
43
+ if ( /^#\w+/.test(href) ) {
35
44
  e.preventDefault()
36
45
 
37
- if ($this.hasClass('active')) {
46
+ if ( $this.parent('li').hasClass('active') ) {
38
47
  return
39
48
  }
40
49
 
50
+ previous = $ul.find('.active a').last()[0]
41
51
  $href = $(href)
42
52
 
43
53
  activate($this.parent('li'), $ul)
44
54
  activate($href, $href.parent())
55
+
56
+ $this.trigger({
57
+ type: 'change'
58
+ , relatedTarget: previous
59
+ })
45
60
  }
46
61
  }
47
62
 
@@ -59,5 +74,4 @@
59
74
  $('body').tabs('ul[data-tabs] li > a, ul[data-pills] > li > a')
60
75
  })
61
76
 
62
- })( window.jQuery || window.ender )
63
-
77
+ }( window.jQuery || window.ender );
@@ -19,7 +19,7 @@
19
19
  * ========================================================== */
20
20
 
21
21
 
22
- (function( $ ) {
22
+ !function( $ ) {
23
23
 
24
24
  /* CSS TRANSITION SUPPORT (https://gist.github.com/373874)
25
25
  * ======================================================= */
@@ -90,7 +90,8 @@
90
90
 
91
91
  actualWidth = $tip[0].offsetWidth
92
92
  actualHeight = $tip[0].offsetHeight
93
- placement = _.maybeCall(this.options.placement, this.$element[0])
93
+
94
+ placement = maybeCall(this.options.placement, this, [ $tip[0], this.$element[0] ])
94
95
 
95
96
  switch (placement) {
96
97
  case 'below':
@@ -193,15 +194,10 @@
193
194
  /* TWIPSY PRIVATE METHODS
194
195
  * ====================== */
195
196
 
196
- var _ = {
197
-
198
- maybeCall: function ( thing, ctx ) {
199
- return (typeof thing == 'function') ? (thing.call(ctx)) : thing
200
- }
201
-
197
+ function maybeCall ( thing, ctx, args ) {
198
+ return typeof thing == 'function' ? thing.apply(ctx, args) : thing
202
199
  }
203
200
 
204
-
205
201
  /* TWIPSY PLUGIN DEFINITION
206
202
  * ======================== */
207
203
 
@@ -304,5 +300,4 @@
304
300
  return $.metadata ? $.extend({}, options, $(ele).metadata()) : options
305
301
  }
306
302
 
307
- })( window.jQuery || window.ender )
308
-
303
+ }( window.jQuery || window.ender );
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bootstrap-sass
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.1
4
+ version: 1.3.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2011-10-12 00:00:00.000000000Z
12
+ date: 2011-10-22 00:00:00.000000000Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: sass-rails
16
- requirement: &70111601189900 !ruby/object:Gem::Requirement
16
+ requirement: &70332401141760 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ~>
@@ -21,7 +21,7 @@ dependencies:
21
21
  version: 3.1.0
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *70111601189900
24
+ version_requirements: *70332401141760
25
25
  description:
26
26
  email: tom@conceptcoding.co.uk
27
27
  executables: []