sass-rails-bootstrap 2.0.2 → 2.0.3a
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +5 -5
- data/lib/sass-rails-bootstrap/version.rb +1 -1
- data/vendor/assets/images/twitter/bootstrap/glyphicons-halflings-white.png +0 -0
- data/vendor/assets/images/twitter/bootstrap/glyphicons-halflings.png +0 -0
- data/vendor/assets/javascripts/twitter/bootstrap/alert.js +28 -32
- data/vendor/assets/javascripts/twitter/bootstrap/button.js +32 -36
- data/vendor/assets/javascripts/twitter/bootstrap/carousel.js +28 -20
- data/vendor/assets/javascripts/twitter/bootstrap/collapse.js +46 -27
- data/vendor/assets/javascripts/twitter/bootstrap/dropdown.js +18 -10
- data/vendor/assets/javascripts/twitter/bootstrap/modal.js +25 -17
- data/vendor/assets/javascripts/twitter/bootstrap/popover.js +4 -6
- data/vendor/assets/javascripts/twitter/bootstrap/scrollspy.js +44 -18
- data/vendor/assets/javascripts/twitter/bootstrap/tab.js +12 -7
- data/vendor/assets/javascripts/twitter/bootstrap/tooltip.js +40 -35
- data/vendor/assets/javascripts/twitter/bootstrap/transition.js +31 -21
- data/vendor/assets/javascripts/twitter/bootstrap/typeahead.js +25 -11
- data/vendor/assets/stylesheets/twitter/_bootstrap-responsive.scss +41 -0
- data/vendor/assets/stylesheets/twitter/_bootstrap.scss +3 -4
- data/vendor/assets/stylesheets/twitter/bootstrap/_accordion.sass +5 -0
- data/vendor/assets/stylesheets/twitter/bootstrap/_button-groups.sass +56 -35
- data/vendor/assets/stylesheets/twitter/bootstrap/_buttons.sass +16 -10
- data/vendor/assets/stylesheets/twitter/bootstrap/_close.sass +11 -1
- data/vendor/assets/stylesheets/twitter/bootstrap/_code.sass +4 -4
- data/vendor/assets/stylesheets/twitter/bootstrap/_component-animations.sass +4 -4
- data/vendor/assets/stylesheets/twitter/bootstrap/_dropdowns.sass +15 -19
- data/vendor/assets/stylesheets/twitter/bootstrap/_forms.sass +58 -28
- data/vendor/assets/stylesheets/twitter/bootstrap/_labels-badges.sass +77 -0
- data/vendor/assets/stylesheets/twitter/bootstrap/_layouts.sass +1 -1
- data/vendor/assets/stylesheets/twitter/bootstrap/_mixins.sass +49 -34
- data/vendor/assets/stylesheets/twitter/bootstrap/_navbar.sass +66 -37
- data/vendor/assets/stylesheets/twitter/bootstrap/_navs.sass +31 -28
- data/vendor/assets/stylesheets/twitter/bootstrap/_progress-bars.sass +16 -7
- data/vendor/assets/stylesheets/twitter/bootstrap/_reset.sass +3 -3
- data/vendor/assets/stylesheets/twitter/bootstrap/_responsive-1200px-min.sass +20 -0
- data/vendor/assets/stylesheets/twitter/bootstrap/_responsive-767px-max.sass +134 -0
- data/vendor/assets/stylesheets/twitter/bootstrap/_responsive-768px-979px.sass +15 -0
- data/vendor/assets/stylesheets/twitter/bootstrap/_responsive-navbar.sass +139 -0
- data/vendor/assets/stylesheets/twitter/bootstrap/_responsive-utilities.sass +50 -0
- data/vendor/assets/stylesheets/twitter/bootstrap/_sprites.sass +45 -4
- data/vendor/assets/stylesheets/twitter/bootstrap/_tables.sass +22 -6
- data/vendor/assets/stylesheets/twitter/bootstrap/_thumbnails.sass +11 -2
- data/vendor/assets/stylesheets/twitter/bootstrap/_type.sass +7 -6
- data/vendor/assets/stylesheets/twitter/bootstrap/_variables.sass +11 -4
- metadata +14 -75
- data/lib/tasks/sass-rails-bootstrap_tasks.rake +0 -4
- data/test/dummy/README.rdoc +0 -261
- data/test/dummy/Rakefile +0 -7
- data/test/dummy/app/assets/javascripts/application.js +0 -15
- data/test/dummy/app/assets/stylesheets/application.css +0 -13
- data/test/dummy/app/controllers/application_controller.rb +0 -3
- data/test/dummy/app/helpers/application_helper.rb +0 -2
- data/test/dummy/app/views/layouts/application.html.erb +0 -14
- data/test/dummy/config/application.rb +0 -56
- data/test/dummy/config/boot.rb +0 -10
- data/test/dummy/config/database.yml +0 -25
- data/test/dummy/config/environment.rb +0 -5
- data/test/dummy/config/environments/development.rb +0 -37
- data/test/dummy/config/environments/production.rb +0 -67
- data/test/dummy/config/environments/test.rb +0 -37
- data/test/dummy/config/initializers/backtrace_silencers.rb +0 -7
- data/test/dummy/config/initializers/inflections.rb +0 -15
- data/test/dummy/config/initializers/mime_types.rb +0 -5
- data/test/dummy/config/initializers/secret_token.rb +0 -7
- data/test/dummy/config/initializers/session_store.rb +0 -8
- data/test/dummy/config/initializers/wrap_parameters.rb +0 -14
- data/test/dummy/config/locales/en.yml +0 -5
- data/test/dummy/config/routes.rb +0 -58
- data/test/dummy/config.ru +0 -4
- data/test/dummy/db/test.sqlite3 +0 -0
- data/test/dummy/log/test.log +0 -2
- data/test/dummy/public/404.html +0 -26
- data/test/dummy/public/422.html +0 -26
- data/test/dummy/public/500.html +0 -25
- data/test/dummy/public/favicon.ico +0 -0
- data/test/dummy/script/rails +0 -6
- data/test/sass-rails-bootstrap_test.rb +0 -7
- data/test/test_helper.rb +0 -10
- data/vendor/assets/stylesheets/twitter/bootstrap/_badges.sass +0 -44
- data/vendor/assets/stylesheets/twitter/bootstrap/_labels.sass +0 -45
- data/vendor/assets/stylesheets/twitter/bootstrap/_responsive.sass +0 -333
data/README.md
CHANGED
@@ -20,7 +20,7 @@ end
|
|
20
20
|
Then include the following line in your Gemfile and you're all set:
|
21
21
|
|
22
22
|
```ruby
|
23
|
-
gem 'sass-rails-bootstrap'
|
23
|
+
gem 'sass-rails-bootstrap'
|
24
24
|
```
|
25
25
|
|
26
26
|
|
@@ -50,7 +50,7 @@ As per the Bootstrap project, `twitter/bootstrap` doesn't include the responsive
|
|
50
50
|
You'd have to import the file manually to get them:
|
51
51
|
|
52
52
|
```css
|
53
|
-
@import "twitter/bootstrap
|
53
|
+
@import "twitter/bootstrap-responsive"
|
54
54
|
```
|
55
55
|
|
56
56
|
|
@@ -63,7 +63,7 @@ that goes into your `application.js` file:
|
|
63
63
|
//= require twitter/bootstrap
|
64
64
|
```
|
65
65
|
|
66
|
-
|
66
|
+
Alternatively, you could include only the files you need:
|
67
67
|
|
68
68
|
```javascript
|
69
69
|
//= require twitter/bootstrap/alert
|
@@ -76,8 +76,8 @@ Or, you could include only the files you need:
|
|
76
76
|
|
77
77
|
This gem will directly track the semantic versioning releases of the Twitter Bootstrap project. Our major and minor versions will always match to theirs.
|
78
78
|
|
79
|
-
Currently,
|
80
|
-
https://github.com/twitter/bootstrap/commit/
|
79
|
+
Currently, this gem reflects the Bootstrap version 2.0.3 up to the commit:
|
80
|
+
https://github.com/twitter/bootstrap/commit/b261f9781bbf31f499cb55c49451dc0c0ad43062
|
81
81
|
|
82
82
|
|
83
83
|
## Copyright and license
|
Binary file
|
Binary file
|
@@ -1,5 +1,5 @@
|
|
1
1
|
/* ==========================================================
|
2
|
-
* bootstrap-alert.js v2.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,61 +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 (
|
30
|
+
, Alert = function (el) {
|
30
31
|
$(el).on('click', dismiss, this.close)
|
31
32
|
}
|
32
33
|
|
33
|
-
Alert.prototype = {
|
34
|
-
|
35
|
-
|
34
|
+
Alert.prototype.close = function (e) {
|
35
|
+
var $this = $(this)
|
36
|
+
, selector = $this.attr('data-target')
|
37
|
+
, $parent
|
36
38
|
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
39
|
+
if (!selector) {
|
40
|
+
selector = $this.attr('href')
|
41
|
+
selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7
|
42
|
+
}
|
41
43
|
|
42
|
-
|
43
|
-
selector = $this.attr('href')
|
44
|
-
selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7
|
45
|
-
}
|
44
|
+
$parent = $(selector)
|
46
45
|
|
47
|
-
|
48
|
-
$parent.trigger('close')
|
46
|
+
e && e.preventDefault()
|
49
47
|
|
50
|
-
|
48
|
+
$parent.length || ($parent = $this.hasClass('alert') ? $this : $this.parent())
|
51
49
|
|
52
|
-
|
50
|
+
$parent.trigger(e = $.Event('close'))
|
53
51
|
|
54
|
-
|
55
|
-
.trigger('close')
|
56
|
-
.removeClass('in')
|
52
|
+
if (e.isDefaultPrevented()) return
|
57
53
|
|
58
|
-
|
59
|
-
$parent
|
60
|
-
.trigger('closed')
|
61
|
-
.remove()
|
62
|
-
}
|
54
|
+
$parent.removeClass('in')
|
63
55
|
|
64
|
-
|
65
|
-
|
66
|
-
|
56
|
+
function removeElement() {
|
57
|
+
$parent
|
58
|
+
.trigger('closed')
|
59
|
+
.remove()
|
67
60
|
}
|
68
61
|
|
62
|
+
$.support.transition && $parent.hasClass('fade') ?
|
63
|
+
$parent.on($.support.transition.end, removeElement) :
|
64
|
+
removeElement()
|
69
65
|
}
|
70
66
|
|
71
67
|
|
72
68
|
/* ALERT PLUGIN DEFINITION
|
73
69
|
* ======================= */
|
74
70
|
|
75
|
-
$.fn.alert = function (
|
71
|
+
$.fn.alert = function (option) {
|
76
72
|
return this.each(function () {
|
77
73
|
var $this = $(this)
|
78
74
|
, data = $this.data('alert')
|
@@ -91,4 +87,4 @@
|
|
91
87
|
$('body').on('click.alert.data-api', dismiss, Alert.prototype.close)
|
92
88
|
})
|
93
89
|
|
94
|
-
}(
|
90
|
+
}(window.jQuery);
|
@@ -1,5 +1,5 @@
|
|
1
1
|
/* ============================================================
|
2
|
-
* bootstrap-button.js v2.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
|
-
|
21
|
+
!function ($) {
|
22
|
+
|
23
|
+
"use strict"; // jshint ;_;
|
24
|
+
|
23
25
|
|
24
26
|
/* BUTTON PUBLIC CLASS DEFINITION
|
25
27
|
* ============================== */
|
26
28
|
|
27
|
-
var Button = function (
|
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
|
-
|
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
|
-
|
37
|
-
|
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
|
-
|
43
|
-
data.resetText || $el.data('resetText', $el[val]())
|
43
|
+
$el[val](data[state] || this.options[state])
|
44
44
|
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
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
|
-
|
59
|
-
|
60
|
-
.removeClass('active')
|
53
|
+
Button.prototype.toggle = function () {
|
54
|
+
var $parent = this.$element.parent('[data-toggle="buttons-radio"]')
|
61
55
|
|
62
|
-
|
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 (
|
67
|
+
$.fn.button = function (option) {
|
72
68
|
return this.each(function () {
|
73
69
|
var $this = $(this)
|
74
70
|
, data = $this.data('button')
|
@@ -91,10 +87,10 @@
|
|
91
87
|
|
92
88
|
$(function () {
|
93
89
|
$('body').on('click.button.data-api', '[data-toggle^=button]', function ( e ) {
|
94
|
-
|
95
|
-
|
96
|
-
|
90
|
+
var $btn = $(e.target)
|
91
|
+
if (!$btn.hasClass('btn')) $btn = $btn.closest('.btn')
|
92
|
+
$btn.button('toggle')
|
97
93
|
})
|
98
94
|
})
|
99
95
|
|
100
|
-
}(
|
96
|
+
}(window.jQuery);
|
@@ -1,5 +1,5 @@
|
|
1
1
|
/* ==========================================================
|
2
|
-
* bootstrap-carousel.js v2.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,16 +18,17 @@
|
|
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 =
|
31
|
+
this.options = options
|
31
32
|
this.options.slide && this.slide(this.options.slide)
|
32
33
|
this.options.pause == 'hover' && this.$element
|
33
34
|
.on('mouseenter', $.proxy(this.pause, this))
|
@@ -36,8 +37,11 @@
|
|
36
37
|
|
37
38
|
Carousel.prototype = {
|
38
39
|
|
39
|
-
cycle: function () {
|
40
|
-
|
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))
|
41
45
|
return this
|
42
46
|
}
|
43
47
|
|
@@ -62,7 +66,8 @@
|
|
62
66
|
return this.slide(pos > activePos ? 'next' : 'prev', $(children[pos]))
|
63
67
|
}
|
64
68
|
|
65
|
-
, pause: function () {
|
69
|
+
, pause: function (e) {
|
70
|
+
if (!e) this.paused = true
|
66
71
|
clearInterval(this.interval)
|
67
72
|
this.interval = null
|
68
73
|
return this
|
@@ -85,33 +90,36 @@
|
|
85
90
|
, direction = type == 'next' ? 'left' : 'right'
|
86
91
|
, fallback = type == 'next' ? 'first' : 'last'
|
87
92
|
, that = this
|
93
|
+
, e = $.Event('slide')
|
88
94
|
|
89
95
|
this.sliding = true
|
90
96
|
|
91
97
|
isCycling && this.pause()
|
92
98
|
|
93
99
|
$next = $next.length ? $next : this.$element.find('.item')[fallback]()
|
94
|
-
|
100
|
+
|
95
101
|
if ($next.hasClass('active')) return
|
96
102
|
|
97
|
-
if (
|
98
|
-
this.$element.trigger(
|
99
|
-
|
100
|
-
$next.addClass('active')
|
101
|
-
this.sliding = false
|
102
|
-
this.$element.trigger('slid')
|
103
|
-
} else {
|
103
|
+
if ($.support.transition && this.$element.hasClass('slide')) {
|
104
|
+
this.$element.trigger(e)
|
105
|
+
if (e.isDefaultPrevented()) return
|
104
106
|
$next.addClass(type)
|
105
107
|
$next[0].offsetWidth // force reflow
|
106
108
|
$active.addClass(direction)
|
107
109
|
$next.addClass(direction)
|
108
|
-
this.$element.trigger('slide')
|
109
110
|
this.$element.one($.support.transition.end, function () {
|
110
111
|
$next.removeClass([type, direction].join(' ')).addClass('active')
|
111
112
|
$active.removeClass(['active', direction].join(' '))
|
112
113
|
that.sliding = false
|
113
114
|
setTimeout(function () { that.$element.trigger('slid') }, 0)
|
114
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')
|
115
123
|
}
|
116
124
|
|
117
125
|
isCycling && this.cycle()
|
@@ -125,15 +133,15 @@
|
|
125
133
|
/* CAROUSEL PLUGIN DEFINITION
|
126
134
|
* ========================== */
|
127
135
|
|
128
|
-
$.fn.carousel = function (
|
136
|
+
$.fn.carousel = function (option) {
|
129
137
|
return this.each(function () {
|
130
138
|
var $this = $(this)
|
131
139
|
, data = $this.data('carousel')
|
132
|
-
, options = typeof option == 'object' && option
|
140
|
+
, options = $.extend({}, $.fn.carousel.defaults, typeof option == 'object' && option)
|
133
141
|
if (!data) $this.data('carousel', (data = new Carousel(this, options)))
|
134
142
|
if (typeof option == 'number') data.to(option)
|
135
143
|
else if (typeof option == 'string' || (option = options.slide)) data[option]()
|
136
|
-
else data.cycle()
|
144
|
+
else if (options.interval) data.cycle()
|
137
145
|
})
|
138
146
|
}
|
139
147
|
|
@@ -158,4 +166,4 @@
|
|
158
166
|
})
|
159
167
|
})
|
160
168
|
|
161
|
-
}(
|
169
|
+
}(window.jQuery);
|
@@ -1,5 +1,5 @@
|
|
1
1
|
/* =============================================================
|
2
|
-
* bootstrap-collapse.js v2.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
|
-
|
21
|
+
!function ($) {
|
23
22
|
|
24
|
-
|
25
|
-
|
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
|
29
|
-
this.$parent = $(this.options
|
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
|
46
|
-
, scroll
|
47
|
-
, actives
|
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
|
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 (
|
82
|
+
, reset: function (size) {
|
70
83
|
var dimension = this.dimension()
|
71
84
|
|
72
85
|
this.$element
|
@@ -74,37 +87,43 @@
|
|
74
87
|
[dimension](size || 'auto')
|
75
88
|
[0].offsetWidth
|
76
89
|
|
77
|
-
this.$element[size ? 'addClass' : 'removeClass']('collapse')
|
78
|
-
|
90
|
+
this.$element[size !== null ? 'addClass' : 'removeClass']('collapse')
|
91
|
+
|
79
92
|
return this
|
80
93
|
}
|
81
94
|
|
82
|
-
, transition: function (
|
95
|
+
, transition: function (method, startEvent, completeEvent) {
|
83
96
|
var that = this
|
84
97
|
, complete = function () {
|
85
|
-
if (startEvent == 'show') that.reset()
|
98
|
+
if (startEvent.type == 'show') that.reset()
|
99
|
+
that.transitioning = 0
|
86
100
|
that.$element.trigger(completeEvent)
|
87
101
|
}
|
88
102
|
|
89
|
-
this.$element
|
90
|
-
|
91
|
-
|
103
|
+
this.$element.trigger(startEvent)
|
104
|
+
|
105
|
+
if (startEvent.isDefaultPrevented()) return
|
106
|
+
|
107
|
+
this.transitioning = 1
|
108
|
+
|
109
|
+
this.$element[method]('in')
|
92
110
|
|
93
111
|
$.support.transition && this.$element.hasClass('collapse') ?
|
94
112
|
this.$element.one($.support.transition.end, complete) :
|
95
113
|
complete()
|
96
|
-
|
114
|
+
}
|
97
115
|
|
98
116
|
, toggle: function () {
|
99
117
|
this[this.$element.hasClass('in') ? 'hide' : 'show']()
|
100
|
-
|
118
|
+
}
|
101
119
|
|
102
120
|
}
|
103
121
|
|
104
|
-
|
122
|
+
|
123
|
+
/* COLLAPSIBLE PLUGIN DEFINITION
|
105
124
|
* ============================== */
|
106
125
|
|
107
|
-
$.fn.collapse = function (
|
126
|
+
$.fn.collapse = function (option) {
|
108
127
|
return this.each(function () {
|
109
128
|
var $this = $(this)
|
110
129
|
, data = $this.data('collapse')
|
@@ -135,4 +154,4 @@
|
|
135
154
|
})
|
136
155
|
})
|
137
156
|
|
138
|
-
}(
|
157
|
+
}(window.jQuery);
|
@@ -1,5 +1,5 @@
|
|
1
1
|
/* ============================================================
|
2
|
-
* bootstrap-dropdown.js v2.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 (
|
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,11 +38,15 @@
|
|
37
38
|
|
38
39
|
constructor: Dropdown
|
39
40
|
|
40
|
-
, toggle: function (
|
41
|
+
, toggle: function (e) {
|
41
42
|
var $this = $(this)
|
42
|
-
, selector = $this.attr('data-target')
|
43
43
|
, $parent
|
44
|
+
, selector
|
44
45
|
, isActive
|
46
|
+
|
47
|
+
if ($this.is('.disabled, :disabled')) return
|
48
|
+
|
49
|
+
selector = $this.attr('data-target')
|
45
50
|
|
46
51
|
if (!selector) {
|
47
52
|
selector = $this.attr('href')
|
@@ -54,7 +59,8 @@
|
|
54
59
|
isActive = $parent.hasClass('open')
|
55
60
|
|
56
61
|
clearMenus()
|
57
|
-
|
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 (
|
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')
|
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
|
-
}(
|
100
|
+
}(window.jQuery);
|