anjlab-bootstrap-rails 2.3.1.2 → 3.0.0.0.alpha1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitmodules +3 -0
- data/Rakefile +42 -26
- data/lib/bootstrap-rails.rb +5 -6
- data/lib/bootstrap-rails/engine.rb +2 -9
- data/lib/bootstrap-rails/version.rb +1 -1
- data/test/test_helper.rb +2 -2
- data/vendor/assets/fonts/twitter/glyphiconshalflings-regular.eot +0 -0
- data/vendor/assets/fonts/twitter/glyphiconshalflings-regular.otf +0 -0
- data/vendor/assets/fonts/twitter/glyphiconshalflings-regular.svg +175 -0
- data/vendor/assets/fonts/twitter/glyphiconshalflings-regular.ttf +0 -0
- data/vendor/assets/fonts/twitter/glyphiconshalflings-regular.woff +0 -0
- data/vendor/assets/javascripts/twitter/bootstrap.js +4 -5
- data/vendor/assets/javascripts/twitter/bootstrap/affix.js +50 -47
- data/vendor/assets/javascripts/twitter/bootstrap/alert.js +32 -35
- data/vendor/assets/javascripts/twitter/bootstrap/button.js +37 -37
- data/vendor/assets/javascripts/twitter/bootstrap/carousel.js +123 -127
- data/vendor/assets/javascripts/twitter/bootstrap/collapse.js +81 -95
- data/vendor/assets/javascripts/twitter/bootstrap/dropdown.js +61 -81
- data/vendor/assets/javascripts/twitter/bootstrap/modal.js +146 -151
- data/vendor/assets/javascripts/twitter/bootstrap/popover.js +53 -58
- data/vendor/assets/javascripts/twitter/bootstrap/scrollspy.js +99 -105
- data/vendor/assets/javascripts/twitter/bootstrap/tab.js +70 -81
- data/vendor/assets/javascripts/twitter/bootstrap/tooltip.js +246 -254
- data/vendor/assets/javascripts/twitter/bootstrap/transition.js +24 -37
- data/vendor/assets/stylesheets/twitter/bootstrap.scss +1 -1
- data/vendor/{frameworks/twitter/bootstrap/accordion.scss → assets/stylesheets/twitter/bootstrap/_accordion.scss} +2 -2
- data/vendor/assets/stylesheets/twitter/bootstrap/_alerts.scss +92 -0
- data/vendor/assets/stylesheets/twitter/bootstrap/_badges.scss +58 -0
- data/vendor/assets/stylesheets/twitter/bootstrap/_bootstrap.scss +64 -0
- data/vendor/assets/stylesheets/twitter/bootstrap/_breadcrumbs.scss +28 -0
- data/vendor/assets/stylesheets/twitter/bootstrap/_button-groups.scss +170 -0
- data/vendor/assets/stylesheets/twitter/bootstrap/_buttons.scss +160 -0
- data/vendor/assets/stylesheets/twitter/bootstrap/_carousel.scss +191 -0
- data/vendor/{frameworks/twitter/bootstrap/close.scss → assets/stylesheets/twitter/bootstrap/_close.scss} +7 -6
- data/vendor/{frameworks/twitter/bootstrap/code.scss → assets/stylesheets/twitter/bootstrap/_code.scss} +14 -14
- data/vendor/{frameworks/twitter/bootstrap/component-animations.scss → assets/stylesheets/twitter/bootstrap/_component-animations.scss} +1 -0
- data/vendor/{frameworks/twitter/bootstrap/dropdowns.scss → assets/stylesheets/twitter/bootstrap/_dropdowns.scss} +46 -57
- data/vendor/assets/stylesheets/twitter/bootstrap/_forms.scss +464 -0
- data/vendor/assets/stylesheets/twitter/bootstrap/_glyphicons.scss +200 -0
- data/vendor/assets/stylesheets/twitter/bootstrap/_grid.scss +65 -0
- data/vendor/assets/stylesheets/twitter/bootstrap/_jumbotron.scss +32 -0
- data/vendor/assets/stylesheets/twitter/bootstrap/_labels.scss +70 -0
- data/vendor/assets/stylesheets/twitter/bootstrap/_list-group.scss +96 -0
- data/vendor/{frameworks/twitter/bootstrap/media.scss → assets/stylesheets/twitter/bootstrap/_media.scss} +0 -1
- data/vendor/assets/stylesheets/twitter/bootstrap/_mixins.scss +510 -0
- data/vendor/assets/stylesheets/twitter/bootstrap/_modals.scss +137 -0
- data/vendor/assets/stylesheets/twitter/bootstrap/_navbar.scss +356 -0
- data/vendor/assets/stylesheets/twitter/bootstrap/_navs.scss +249 -0
- data/vendor/assets/stylesheets/twitter/bootstrap/_normalize.scss +396 -0
- data/vendor/assets/stylesheets/twitter/bootstrap/_pager.scss +54 -0
- data/vendor/assets/stylesheets/twitter/bootstrap/_pagination.scss +87 -0
- data/vendor/assets/stylesheets/twitter/bootstrap/_panels.scss +96 -0
- data/vendor/{frameworks/twitter/bootstrap/popovers.scss → assets/stylesheets/twitter/bootstrap/_popovers.scss} +32 -32
- data/vendor/assets/stylesheets/twitter/bootstrap/_print.scss +74 -0
- data/vendor/{frameworks/twitter/bootstrap/progress-bars.scss → assets/stylesheets/twitter/bootstrap/_progress-bars.scss} +40 -44
- data/vendor/assets/stylesheets/twitter/bootstrap/_responsive-utilities.scss +77 -0
- data/vendor/assets/stylesheets/twitter/bootstrap/_scaffolding.scss +83 -0
- data/vendor/assets/stylesheets/twitter/bootstrap/_tables.scss +242 -0
- data/vendor/assets/stylesheets/twitter/bootstrap/_thumbnails.scss +43 -0
- data/vendor/{frameworks/twitter/bootstrap/tooltip.scss → assets/stylesheets/twitter/bootstrap/_tooltip.scss} +20 -19
- data/vendor/assets/stylesheets/twitter/bootstrap/_type.scss +253 -0
- data/vendor/{frameworks/twitter/bootstrap/utilities.scss → assets/stylesheets/twitter/bootstrap/_utilities.scss} +17 -5
- data/vendor/assets/stylesheets/twitter/bootstrap/_variables.scss +416 -0
- data/vendor/{frameworks/twitter/bootstrap/wells.scss → assets/stylesheets/twitter/bootstrap/_wells.scss} +5 -5
- metadata +49 -53
- data/lib/bootstrap-rails/ie_hex_str.rb +0 -16
- data/test/ie_hex_str_test.rb +0 -26
- data/vendor/assets/images/twitter/glyphicons-halflings-white.png +0 -0
- data/vendor/assets/images/twitter/glyphicons-halflings.png +0 -0
- data/vendor/assets/javascripts/twitter/bootstrap/typeahead.js +0 -335
- data/vendor/assets/stylesheets/twitter/bootstrap-responsive.scss +0 -1
- data/vendor/frameworks/twitter/bootstrap.scss +0 -1
- data/vendor/frameworks/twitter/bootstrap/alerts.scss +0 -79
- data/vendor/frameworks/twitter/bootstrap/bootstrap.scss +0 -63
- data/vendor/frameworks/twitter/bootstrap/breadcrumbs.scss +0 -24
- data/vendor/frameworks/twitter/bootstrap/button-groups.scss +0 -230
- data/vendor/frameworks/twitter/bootstrap/buttons.scss +0 -228
- data/vendor/frameworks/twitter/bootstrap/carousel.scss +0 -158
- data/vendor/frameworks/twitter/bootstrap/forms.scss +0 -690
- data/vendor/frameworks/twitter/bootstrap/grid.scss +0 -21
- data/vendor/frameworks/twitter/bootstrap/hero-unit.scss +0 -25
- data/vendor/frameworks/twitter/bootstrap/labels-badges.scss +0 -83
- data/vendor/frameworks/twitter/bootstrap/layouts.scss +0 -16
- data/vendor/frameworks/twitter/bootstrap/mixins.scss +0 -704
- data/vendor/frameworks/twitter/bootstrap/modals.scss +0 -95
- data/vendor/frameworks/twitter/bootstrap/navbar.scss +0 -496
- data/vendor/frameworks/twitter/bootstrap/navs.scss +0 -409
- data/vendor/frameworks/twitter/bootstrap/pager.scss +0 -43
- data/vendor/frameworks/twitter/bootstrap/pagination.scss +0 -123
- data/vendor/frameworks/twitter/bootstrap/reset.scss +0 -216
- data/vendor/frameworks/twitter/bootstrap/responsive-1200px-min.scss +0 -28
- data/vendor/frameworks/twitter/bootstrap/responsive-767px-max.scss +0 -189
- data/vendor/frameworks/twitter/bootstrap/responsive-768px-979px.scss +0 -19
- data/vendor/frameworks/twitter/bootstrap/responsive-navbar.scss +0 -189
- data/vendor/frameworks/twitter/bootstrap/responsive-utilities.scss +0 -59
- data/vendor/frameworks/twitter/bootstrap/responsive.scss +0 -48
- data/vendor/frameworks/twitter/bootstrap/scaffolding.scss +0 -53
- data/vendor/frameworks/twitter/bootstrap/sprites.scss +0 -197
- data/vendor/frameworks/twitter/bootstrap/tables.scss +0 -235
- data/vendor/frameworks/twitter/bootstrap/thumbnails.scss +0 -53
- data/vendor/frameworks/twitter/bootstrap/type.scss +0 -246
- data/vendor/frameworks/twitter/bootstrap/variables.scss +0 -295
@@ -1,7 +1,7 @@
|
|
1
|
-
/*
|
2
|
-
*
|
1
|
+
/* ========================================================================
|
2
|
+
* Bootstrap: collapse.js v3.0.0
|
3
3
|
* http://twitter.github.com/bootstrap/javascript.html#collapse
|
4
|
-
*
|
4
|
+
* ========================================================================
|
5
5
|
* Copyright 2012 Twitter, Inc.
|
6
6
|
*
|
7
7
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
@@ -15,135 +15,120 @@
|
|
15
15
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
16
16
|
* See the License for the specific language governing permissions and
|
17
17
|
* limitations under the License.
|
18
|
-
*
|
18
|
+
* ======================================================================== */
|
19
19
|
|
20
20
|
|
21
|
-
|
21
|
+
+function ($) { "use strict";
|
22
22
|
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
/* COLLAPSE PUBLIC CLASS DEFINITION
|
27
|
-
* ================================ */
|
23
|
+
// COLLAPSE PUBLIC CLASS DEFINITION
|
24
|
+
// ================================
|
28
25
|
|
29
26
|
var Collapse = function (element, options) {
|
30
|
-
this.$element
|
31
|
-
this.options
|
27
|
+
this.$element = $(element)
|
28
|
+
this.options = $.extend({}, Collapse.DEFAULTS, options)
|
29
|
+
this.transitioning = null
|
32
30
|
|
33
|
-
if (this.options.parent)
|
34
|
-
|
35
|
-
|
31
|
+
if (this.options.parent) this.$parent = $(this.options.parent)
|
32
|
+
if (this.options.toggle) this.toggle()
|
33
|
+
}
|
36
34
|
|
37
|
-
|
35
|
+
Collapse.DEFAULTS = {
|
36
|
+
toggle: true
|
38
37
|
}
|
39
38
|
|
40
|
-
Collapse.prototype = {
|
39
|
+
Collapse.prototype.dimension = function () {
|
40
|
+
var hasWidth = this.$element.hasClass('width')
|
41
|
+
return hasWidth ? 'width' : 'height'
|
42
|
+
}
|
41
43
|
|
42
|
-
|
44
|
+
Collapse.prototype.show = function () {
|
45
|
+
if (this.transitioning || this.$element.hasClass('in')) return
|
43
46
|
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
}
|
47
|
+
var dimension = this.dimension()
|
48
|
+
var scroll = $.camelCase(['scroll', dimension].join('-'))
|
49
|
+
var actives = this.$parent && this.$parent.find('> .accordion-group > .in')
|
48
50
|
|
49
|
-
|
50
|
-
var
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
if (this.transitioning || this.$element.hasClass('in')) return
|
51
|
+
if (actives && actives.length) {
|
52
|
+
var hasData = actives.data('collapse')
|
53
|
+
if (hasData && hasData.transitioning) return
|
54
|
+
actives.collapse('hide')
|
55
|
+
hasData || actives.data('collapse', null)
|
56
|
+
}
|
56
57
|
|
57
|
-
|
58
|
-
|
59
|
-
actives = this.$parent && this.$parent.find('> .accordion-group > .in')
|
58
|
+
this.$element[dimension](0)
|
59
|
+
this.transition('addClass', $.Event('show.bs.collapse'), 'shown.bs.collapse')
|
60
60
|
|
61
|
-
|
62
|
-
|
63
|
-
if (hasData && hasData.transitioning) return
|
64
|
-
actives.collapse('hide')
|
65
|
-
hasData || actives.data('collapse', null)
|
66
|
-
}
|
61
|
+
if ($.support.transition) this.$element[dimension](this.$element[0][scroll])
|
62
|
+
}
|
67
63
|
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
64
|
+
Collapse.prototype.hide = function () {
|
65
|
+
if (this.transitioning || !this.$element.hasClass('in')) return
|
66
|
+
var dimension = this.dimension()
|
67
|
+
this.reset(this.$element[dimension]())
|
68
|
+
this.transition('removeClass', $.Event('hide.bs.collapse'), 'hidden')
|
69
|
+
this.$element[dimension](0)
|
70
|
+
}
|
72
71
|
|
73
|
-
|
74
|
-
|
75
|
-
if (this.transitioning || !this.$element.hasClass('in')) return
|
76
|
-
dimension = this.dimension()
|
77
|
-
this.reset(this.$element[dimension]())
|
78
|
-
this.transition('removeClass', $.Event('hide'), 'hidden')
|
79
|
-
this.$element[dimension](0)
|
80
|
-
}
|
72
|
+
Collapse.prototype.reset = function (size) {
|
73
|
+
var dimension = this.dimension()
|
81
74
|
|
82
|
-
|
83
|
-
|
75
|
+
this.$element
|
76
|
+
.removeClass('collapse')
|
77
|
+
[dimension](size || 'auto')
|
78
|
+
[0].offsetWidth
|
84
79
|
|
85
|
-
|
86
|
-
.removeClass('collapse')
|
87
|
-
[dimension](size || 'auto')
|
88
|
-
[0].offsetWidth
|
80
|
+
this.$element[size !== null ? 'addClass' : 'removeClass']('collapse')
|
89
81
|
|
90
|
-
|
82
|
+
return this
|
83
|
+
}
|
91
84
|
|
92
|
-
|
85
|
+
Collapse.prototype.transition = function (method, startEvent, completeEvent) {
|
86
|
+
var that = this
|
87
|
+
var complete = function () {
|
88
|
+
if (startEvent.type == 'show') that.reset()
|
89
|
+
that.transitioning = 0
|
90
|
+
that.$element.trigger(completeEvent)
|
93
91
|
}
|
94
92
|
|
95
|
-
|
96
|
-
var that = this
|
97
|
-
, complete = function () {
|
98
|
-
if (startEvent.type == 'show') that.reset()
|
99
|
-
that.transitioning = 0
|
100
|
-
that.$element.trigger(completeEvent)
|
101
|
-
}
|
102
|
-
|
103
|
-
this.$element.trigger(startEvent)
|
93
|
+
this.$element.trigger(startEvent)
|
104
94
|
|
105
|
-
|
95
|
+
if (startEvent.isDefaultPrevented()) return
|
106
96
|
|
107
|
-
|
97
|
+
this.transitioning = 1
|
108
98
|
|
109
|
-
|
99
|
+
this.$element[method]('in')
|
110
100
|
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
, toggle: function () {
|
117
|
-
this[this.$element.hasClass('in') ? 'hide' : 'show']()
|
118
|
-
}
|
101
|
+
$.support.transition && this.$element.hasClass('collapse') ?
|
102
|
+
this.$element.one($.support.transition.end, complete) :
|
103
|
+
complete()
|
104
|
+
}
|
119
105
|
|
106
|
+
Collapse.prototype.toggle = function () {
|
107
|
+
this[this.$element.hasClass('in') ? 'hide' : 'show']()
|
120
108
|
}
|
121
109
|
|
122
110
|
|
123
|
-
|
124
|
-
|
111
|
+
// COLLAPSE PLUGIN DEFINITION
|
112
|
+
// ==========================
|
125
113
|
|
126
114
|
var old = $.fn.collapse
|
127
115
|
|
128
116
|
$.fn.collapse = function (option) {
|
129
117
|
return this.each(function () {
|
130
|
-
var $this
|
131
|
-
|
132
|
-
|
118
|
+
var $this = $(this)
|
119
|
+
var data = $this.data('collapse')
|
120
|
+
var options = $.extend({}, Collapse.DEFAULTS, $this.data(), typeof option == 'object' && option)
|
121
|
+
|
133
122
|
if (!data) $this.data('collapse', (data = new Collapse(this, options)))
|
134
123
|
if (typeof option == 'string') data[option]()
|
135
124
|
})
|
136
125
|
}
|
137
126
|
|
138
|
-
$.fn.collapse.defaults = {
|
139
|
-
toggle: true
|
140
|
-
}
|
141
|
-
|
142
127
|
$.fn.collapse.Constructor = Collapse
|
143
128
|
|
144
129
|
|
145
|
-
|
146
|
-
|
130
|
+
// COLLAPSE NO CONFLICT
|
131
|
+
// ====================
|
147
132
|
|
148
133
|
$.fn.collapse.noConflict = function () {
|
149
134
|
$.fn.collapse = old
|
@@ -151,17 +136,18 @@
|
|
151
136
|
}
|
152
137
|
|
153
138
|
|
154
|
-
|
155
|
-
|
139
|
+
// COLLAPSE DATA-API
|
140
|
+
// =================
|
156
141
|
|
157
142
|
$(document).on('click.collapse.data-api', '[data-toggle=collapse]', function (e) {
|
158
|
-
var $this
|
159
|
-
|
143
|
+
var $this = $(this), href
|
144
|
+
var target = $this.attr('data-target')
|
160
145
|
|| e.preventDefault()
|
161
146
|
|| (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '') //strip for ie7
|
162
|
-
|
147
|
+
var option = $(target).data('collapse') ? 'toggle' : $this.data()
|
148
|
+
|
163
149
|
$this[$(target).hasClass('in') ? 'addClass' : 'removeClass']('collapsed')
|
164
150
|
$(target).collapse(option)
|
165
151
|
})
|
166
152
|
|
167
|
-
}(window.jQuery);
|
153
|
+
}(window.jQuery);
|
@@ -1,7 +1,7 @@
|
|
1
|
-
/*
|
2
|
-
*
|
1
|
+
/* ========================================================================
|
2
|
+
* Bootstrap: dropdown.js v3.0.0
|
3
3
|
* http://twitter.github.com/bootstrap/javascript.html#dropdowns
|
4
|
-
*
|
4
|
+
* ========================================================================
|
5
5
|
* Copyright 2012 Twitter, Inc.
|
6
6
|
*
|
7
7
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
@@ -15,126 +15,106 @@
|
|
15
15
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
16
16
|
* See the License for the specific language governing permissions and
|
17
17
|
* limitations under the License.
|
18
|
-
*
|
18
|
+
* ======================================================================== */
|
19
19
|
|
20
20
|
|
21
|
-
|
21
|
+
+function ($) { "use strict";
|
22
22
|
|
23
|
-
|
23
|
+
// DROPDOWN CLASS DEFINITION
|
24
|
+
// =========================
|
24
25
|
|
26
|
+
var backdrop = '.dropdown-backdrop'
|
27
|
+
var toggle = '[data-toggle=dropdown]'
|
28
|
+
var Dropdown = function (element) {
|
29
|
+
var $el = $(element).on('click.dropdown.data-api', this.toggle)
|
30
|
+
$('html').on('click.dropdown.data-api', function () {
|
31
|
+
$el.parent().removeClass('open')
|
32
|
+
})
|
33
|
+
}
|
25
34
|
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
var toggle = '[data-toggle=dropdown]'
|
30
|
-
, Dropdown = function (element) {
|
31
|
-
var $el = $(element).on('click.dropdown.data-api', this.toggle)
|
32
|
-
$('html').on('click.dropdown.data-api', function () {
|
33
|
-
$el.parent().removeClass('open')
|
34
|
-
})
|
35
|
-
}
|
36
|
-
|
37
|
-
Dropdown.prototype = {
|
38
|
-
|
39
|
-
constructor: Dropdown
|
40
|
-
|
41
|
-
, toggle: function (e) {
|
42
|
-
var $this = $(this)
|
43
|
-
, $parent
|
44
|
-
, isActive
|
45
|
-
|
46
|
-
if ($this.is('.disabled, :disabled')) return
|
35
|
+
Dropdown.prototype.toggle = function (e) {
|
36
|
+
var $this = $(this)
|
47
37
|
|
48
|
-
|
38
|
+
if ($this.is('.disabled, :disabled')) return
|
49
39
|
|
50
|
-
|
40
|
+
var $parent = getParent($this)
|
41
|
+
var isActive = $parent.hasClass('open')
|
51
42
|
|
52
|
-
|
43
|
+
clearMenus()
|
53
44
|
|
54
|
-
|
55
|
-
|
45
|
+
if (!isActive) {
|
46
|
+
if ('ontouchstart' in document.documentElement) {
|
47
|
+
// if mobile we we use a backdrop because click events don't delegate
|
48
|
+
$('<div class="dropdown-backdrop"/>').insertBefore($(this)).on('click', clearMenus)
|
56
49
|
}
|
57
|
-
|
58
|
-
$this.focus()
|
59
|
-
|
60
|
-
return false
|
50
|
+
$parent.toggleClass('open')
|
61
51
|
}
|
62
52
|
|
63
|
-
|
64
|
-
var $this
|
65
|
-
, $items
|
66
|
-
, $active
|
67
|
-
, $parent
|
68
|
-
, isActive
|
69
|
-
, index
|
53
|
+
$this.focus()
|
70
54
|
|
71
|
-
|
55
|
+
return false
|
56
|
+
}
|
72
57
|
|
73
|
-
|
58
|
+
Dropdown.prototype.keydown = function (e) {
|
59
|
+
if (!/(38|40|27)/.test(e.keyCode)) return
|
74
60
|
|
75
|
-
|
76
|
-
e.stopPropagation()
|
61
|
+
var $this = $(this)
|
77
62
|
|
78
|
-
|
63
|
+
e.preventDefault()
|
64
|
+
e.stopPropagation()
|
79
65
|
|
80
|
-
|
66
|
+
if ($this.is('.disabled, :disabled')) return
|
81
67
|
|
82
|
-
|
68
|
+
var $parent = getParent($this)
|
69
|
+
var isActive = $parent.hasClass('open')
|
83
70
|
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
$items = $('[role=menu] li:not(.divider):visible a', $parent)
|
71
|
+
if (!isActive || (isActive && e.keyCode == 27)) {
|
72
|
+
if (e.which == 27) $parent.find(toggle).focus()
|
73
|
+
return $this.click()
|
74
|
+
}
|
90
75
|
|
91
|
-
|
76
|
+
var $items = $('[role=menu] li:not(.divider):visible a', $parent)
|
92
77
|
|
93
|
-
|
78
|
+
if (!$items.length) return
|
94
79
|
|
95
|
-
|
96
|
-
if (e.keyCode == 40 && index < $items.length - 1) index++ // down
|
97
|
-
if (!~index) index = 0
|
80
|
+
var index = $items.index($items.filter(':focus'))
|
98
81
|
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
}
|
82
|
+
if (e.keyCode == 38 && index > 0) index-- // up
|
83
|
+
if (e.keyCode == 40 && index < $items.length - 1) index++ // down
|
84
|
+
if (!~index) index=0
|
103
85
|
|
86
|
+
$items.eq(index).focus()
|
104
87
|
}
|
105
88
|
|
106
89
|
function clearMenus() {
|
107
|
-
$(
|
108
|
-
|
109
|
-
})
|
90
|
+
$(backdrop).remove()
|
91
|
+
$(toggle).each(function () { getParent($(this)).removeClass('open') })
|
110
92
|
}
|
111
93
|
|
112
94
|
function getParent($this) {
|
113
95
|
var selector = $this.attr('data-target')
|
114
|
-
, $parent
|
115
96
|
|
116
97
|
if (!selector) {
|
117
98
|
selector = $this.attr('href')
|
118
99
|
selector = selector && /#/.test(selector) && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7
|
119
100
|
}
|
120
101
|
|
121
|
-
$parent = selector && $(selector)
|
122
|
-
|
123
|
-
if (!$parent || !$parent.length) $parent = $this.parent()
|
102
|
+
var $parent = selector && $(selector)
|
124
103
|
|
125
|
-
return $parent
|
104
|
+
return $parent && $parent.length ? $parent : $this.parent()
|
126
105
|
}
|
127
106
|
|
128
107
|
|
129
|
-
|
130
|
-
|
108
|
+
// DROPDOWN PLUGIN DEFINITION
|
109
|
+
// ==========================
|
131
110
|
|
132
111
|
var old = $.fn.dropdown
|
133
112
|
|
134
113
|
$.fn.dropdown = function (option) {
|
135
114
|
return this.each(function () {
|
136
115
|
var $this = $(this)
|
137
|
-
|
116
|
+
var data = $this.data('dropdown')
|
117
|
+
|
138
118
|
if (!data) $this.data('dropdown', (data = new Dropdown(this)))
|
139
119
|
if (typeof option == 'string') data[option].call($this)
|
140
120
|
})
|
@@ -143,8 +123,8 @@
|
|
143
123
|
$.fn.dropdown.Constructor = Dropdown
|
144
124
|
|
145
125
|
|
146
|
-
|
147
|
-
|
126
|
+
// DROPDOWN NO CONFLICT
|
127
|
+
// ====================
|
148
128
|
|
149
129
|
$.fn.dropdown.noConflict = function () {
|
150
130
|
$.fn.dropdown = old
|
@@ -152,13 +132,13 @@
|
|
152
132
|
}
|
153
133
|
|
154
134
|
|
155
|
-
|
156
|
-
|
135
|
+
// APPLY TO STANDARD DROPDOWN ELEMENTS
|
136
|
+
// ===================================
|
137
|
+
|
157
138
|
|
158
139
|
$(document)
|
159
140
|
.on('click.dropdown.data-api', clearMenus)
|
160
141
|
.on('click.dropdown.data-api', '.dropdown form', function (e) { e.stopPropagation() })
|
161
|
-
.on('click.dropdown-menu', function (e) { e.stopPropagation() })
|
162
142
|
.on('click.dropdown.data-api' , toggle, Dropdown.prototype.toggle)
|
163
143
|
.on('keydown.dropdown.data-api', toggle + ', [role=menu]' , Dropdown.prototype.keydown)
|
164
144
|
|