Mercurial > wikked
annotate static/bootstrap/js/bootstrap-dropdown.js @ 88:a5a3d454eac9
Updated Bootstrap.
author | Ludovic Chabant <ludovic@chabant.com> |
---|---|
date | Fri, 05 Apr 2013 08:08:12 -0700 |
parents | 130eccd396d8 |
children |
rev | line source |
---|---|
61
130eccd396d8
Now using Boostrap with LESS.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
1 /* ============================================================ |
88 | 2 * bootstrap-dropdown.js v2.3.1 |
61
130eccd396d8
Now using Boostrap with LESS.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
3 * http://twitter.github.com/bootstrap/javascript.html#dropdowns |
130eccd396d8
Now using Boostrap with LESS.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
4 * ============================================================ |
130eccd396d8
Now using Boostrap with LESS.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
5 * Copyright 2012 Twitter, Inc. |
130eccd396d8
Now using Boostrap with LESS.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
6 * |
130eccd396d8
Now using Boostrap with LESS.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
7 * Licensed under the Apache License, Version 2.0 (the "License"); |
130eccd396d8
Now using Boostrap with LESS.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
8 * you may not use this file except in compliance with the License. |
130eccd396d8
Now using Boostrap with LESS.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
9 * You may obtain a copy of the License at |
130eccd396d8
Now using Boostrap with LESS.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
10 * |
130eccd396d8
Now using Boostrap with LESS.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
11 * http://www.apache.org/licenses/LICENSE-2.0 |
130eccd396d8
Now using Boostrap with LESS.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
12 * |
130eccd396d8
Now using Boostrap with LESS.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
13 * Unless required by applicable law or agreed to in writing, software |
130eccd396d8
Now using Boostrap with LESS.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
14 * distributed under the License is distributed on an "AS IS" BASIS, |
130eccd396d8
Now using Boostrap with LESS.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
130eccd396d8
Now using Boostrap with LESS.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
16 * See the License for the specific language governing permissions and |
130eccd396d8
Now using Boostrap with LESS.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
17 * limitations under the License. |
130eccd396d8
Now using Boostrap with LESS.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
18 * ============================================================ */ |
130eccd396d8
Now using Boostrap with LESS.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
19 |
130eccd396d8
Now using Boostrap with LESS.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
20 |
130eccd396d8
Now using Boostrap with LESS.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
21 !function ($) { |
130eccd396d8
Now using Boostrap with LESS.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
22 |
130eccd396d8
Now using Boostrap with LESS.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
23 "use strict"; // jshint ;_; |
130eccd396d8
Now using Boostrap with LESS.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
24 |
130eccd396d8
Now using Boostrap with LESS.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
25 |
130eccd396d8
Now using Boostrap with LESS.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
26 /* DROPDOWN CLASS DEFINITION |
130eccd396d8
Now using Boostrap with LESS.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
27 * ========================= */ |
130eccd396d8
Now using Boostrap with LESS.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
28 |
130eccd396d8
Now using Boostrap with LESS.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
29 var toggle = '[data-toggle=dropdown]' |
130eccd396d8
Now using Boostrap with LESS.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
30 , Dropdown = function (element) { |
130eccd396d8
Now using Boostrap with LESS.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
31 var $el = $(element).on('click.dropdown.data-api', this.toggle) |
130eccd396d8
Now using Boostrap with LESS.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
32 $('html').on('click.dropdown.data-api', function () { |
130eccd396d8
Now using Boostrap with LESS.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
33 $el.parent().removeClass('open') |
130eccd396d8
Now using Boostrap with LESS.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
34 }) |
130eccd396d8
Now using Boostrap with LESS.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
35 } |
130eccd396d8
Now using Boostrap with LESS.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
36 |
130eccd396d8
Now using Boostrap with LESS.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
37 Dropdown.prototype = { |
130eccd396d8
Now using Boostrap with LESS.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
38 |
130eccd396d8
Now using Boostrap with LESS.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
39 constructor: Dropdown |
130eccd396d8
Now using Boostrap with LESS.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
40 |
130eccd396d8
Now using Boostrap with LESS.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
41 , toggle: function (e) { |
130eccd396d8
Now using Boostrap with LESS.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
42 var $this = $(this) |
130eccd396d8
Now using Boostrap with LESS.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
43 , $parent |
130eccd396d8
Now using Boostrap with LESS.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
44 , isActive |
130eccd396d8
Now using Boostrap with LESS.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
45 |
130eccd396d8
Now using Boostrap with LESS.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
46 if ($this.is('.disabled, :disabled')) return |
130eccd396d8
Now using Boostrap with LESS.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
47 |
130eccd396d8
Now using Boostrap with LESS.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
48 $parent = getParent($this) |
130eccd396d8
Now using Boostrap with LESS.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
49 |
130eccd396d8
Now using Boostrap with LESS.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
50 isActive = $parent.hasClass('open') |
130eccd396d8
Now using Boostrap with LESS.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
51 |
130eccd396d8
Now using Boostrap with LESS.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
52 clearMenus() |
130eccd396d8
Now using Boostrap with LESS.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
53 |
130eccd396d8
Now using Boostrap with LESS.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
54 if (!isActive) { |
130eccd396d8
Now using Boostrap with LESS.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
55 $parent.toggleClass('open') |
130eccd396d8
Now using Boostrap with LESS.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
56 } |
130eccd396d8
Now using Boostrap with LESS.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
57 |
130eccd396d8
Now using Boostrap with LESS.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
58 $this.focus() |
130eccd396d8
Now using Boostrap with LESS.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
59 |
130eccd396d8
Now using Boostrap with LESS.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
60 return false |
130eccd396d8
Now using Boostrap with LESS.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
61 } |
130eccd396d8
Now using Boostrap with LESS.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
62 |
130eccd396d8
Now using Boostrap with LESS.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
63 , keydown: function (e) { |
130eccd396d8
Now using Boostrap with LESS.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
64 var $this |
130eccd396d8
Now using Boostrap with LESS.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
65 , $items |
130eccd396d8
Now using Boostrap with LESS.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
66 , $active |
130eccd396d8
Now using Boostrap with LESS.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
67 , $parent |
130eccd396d8
Now using Boostrap with LESS.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
68 , isActive |
130eccd396d8
Now using Boostrap with LESS.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
69 , index |
130eccd396d8
Now using Boostrap with LESS.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
70 |
130eccd396d8
Now using Boostrap with LESS.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
71 if (!/(38|40|27)/.test(e.keyCode)) return |
130eccd396d8
Now using Boostrap with LESS.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
72 |
130eccd396d8
Now using Boostrap with LESS.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
73 $this = $(this) |
130eccd396d8
Now using Boostrap with LESS.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
74 |
130eccd396d8
Now using Boostrap with LESS.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
75 e.preventDefault() |
130eccd396d8
Now using Boostrap with LESS.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
76 e.stopPropagation() |
130eccd396d8
Now using Boostrap with LESS.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
77 |
130eccd396d8
Now using Boostrap with LESS.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
78 if ($this.is('.disabled, :disabled')) return |
130eccd396d8
Now using Boostrap with LESS.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
79 |
130eccd396d8
Now using Boostrap with LESS.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
80 $parent = getParent($this) |
130eccd396d8
Now using Boostrap with LESS.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
81 |
130eccd396d8
Now using Boostrap with LESS.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
82 isActive = $parent.hasClass('open') |
130eccd396d8
Now using Boostrap with LESS.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
83 |
88 | 84 if (!isActive || (isActive && e.keyCode == 27)) { |
85 if (e.which == 27) $parent.find(toggle).focus() | |
86 return $this.click() | |
87 } | |
61
130eccd396d8
Now using Boostrap with LESS.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
88 |
130eccd396d8
Now using Boostrap with LESS.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
89 $items = $('[role=menu] li:not(.divider):visible a', $parent) |
130eccd396d8
Now using Boostrap with LESS.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
90 |
130eccd396d8
Now using Boostrap with LESS.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
91 if (!$items.length) return |
130eccd396d8
Now using Boostrap with LESS.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
92 |
130eccd396d8
Now using Boostrap with LESS.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
93 index = $items.index($items.filter(':focus')) |
130eccd396d8
Now using Boostrap with LESS.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
94 |
130eccd396d8
Now using Boostrap with LESS.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
95 if (e.keyCode == 38 && index > 0) index-- // up |
130eccd396d8
Now using Boostrap with LESS.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
96 if (e.keyCode == 40 && index < $items.length - 1) index++ // down |
130eccd396d8
Now using Boostrap with LESS.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
97 if (!~index) index = 0 |
130eccd396d8
Now using Boostrap with LESS.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
98 |
130eccd396d8
Now using Boostrap with LESS.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
99 $items |
130eccd396d8
Now using Boostrap with LESS.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
100 .eq(index) |
130eccd396d8
Now using Boostrap with LESS.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
101 .focus() |
130eccd396d8
Now using Boostrap with LESS.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
102 } |
130eccd396d8
Now using Boostrap with LESS.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
103 |
130eccd396d8
Now using Boostrap with LESS.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
104 } |
130eccd396d8
Now using Boostrap with LESS.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
105 |
130eccd396d8
Now using Boostrap with LESS.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
106 function clearMenus() { |
130eccd396d8
Now using Boostrap with LESS.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
107 $(toggle).each(function () { |
130eccd396d8
Now using Boostrap with LESS.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
108 getParent($(this)).removeClass('open') |
130eccd396d8
Now using Boostrap with LESS.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
109 }) |
130eccd396d8
Now using Boostrap with LESS.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
110 } |
130eccd396d8
Now using Boostrap with LESS.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
111 |
130eccd396d8
Now using Boostrap with LESS.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
112 function getParent($this) { |
130eccd396d8
Now using Boostrap with LESS.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
113 var selector = $this.attr('data-target') |
130eccd396d8
Now using Boostrap with LESS.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
114 , $parent |
130eccd396d8
Now using Boostrap with LESS.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
115 |
130eccd396d8
Now using Boostrap with LESS.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
116 if (!selector) { |
130eccd396d8
Now using Boostrap with LESS.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
117 selector = $this.attr('href') |
130eccd396d8
Now using Boostrap with LESS.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
118 selector = selector && /#/.test(selector) && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7 |
130eccd396d8
Now using Boostrap with LESS.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
119 } |
130eccd396d8
Now using Boostrap with LESS.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
120 |
88 | 121 $parent = selector && $(selector) |
122 | |
123 if (!$parent || !$parent.length) $parent = $this.parent() | |
61
130eccd396d8
Now using Boostrap with LESS.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
124 |
130eccd396d8
Now using Boostrap with LESS.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
125 return $parent |
130eccd396d8
Now using Boostrap with LESS.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
126 } |
130eccd396d8
Now using Boostrap with LESS.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
127 |
130eccd396d8
Now using Boostrap with LESS.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
128 |
130eccd396d8
Now using Boostrap with LESS.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
129 /* DROPDOWN PLUGIN DEFINITION |
130eccd396d8
Now using Boostrap with LESS.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
130 * ========================== */ |
130eccd396d8
Now using Boostrap with LESS.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
131 |
130eccd396d8
Now using Boostrap with LESS.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
132 var old = $.fn.dropdown |
130eccd396d8
Now using Boostrap with LESS.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
133 |
130eccd396d8
Now using Boostrap with LESS.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
134 $.fn.dropdown = function (option) { |
130eccd396d8
Now using Boostrap with LESS.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
135 return this.each(function () { |
130eccd396d8
Now using Boostrap with LESS.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
136 var $this = $(this) |
130eccd396d8
Now using Boostrap with LESS.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
137 , data = $this.data('dropdown') |
130eccd396d8
Now using Boostrap with LESS.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
138 if (!data) $this.data('dropdown', (data = new Dropdown(this))) |
130eccd396d8
Now using Boostrap with LESS.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
139 if (typeof option == 'string') data[option].call($this) |
130eccd396d8
Now using Boostrap with LESS.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
140 }) |
130eccd396d8
Now using Boostrap with LESS.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
141 } |
130eccd396d8
Now using Boostrap with LESS.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
142 |
130eccd396d8
Now using Boostrap with LESS.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
143 $.fn.dropdown.Constructor = Dropdown |
130eccd396d8
Now using Boostrap with LESS.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
144 |
130eccd396d8
Now using Boostrap with LESS.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
145 |
130eccd396d8
Now using Boostrap with LESS.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
146 /* DROPDOWN NO CONFLICT |
130eccd396d8
Now using Boostrap with LESS.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
147 * ==================== */ |
130eccd396d8
Now using Boostrap with LESS.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
148 |
130eccd396d8
Now using Boostrap with LESS.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
149 $.fn.dropdown.noConflict = function () { |
130eccd396d8
Now using Boostrap with LESS.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
150 $.fn.dropdown = old |
130eccd396d8
Now using Boostrap with LESS.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
151 return this |
130eccd396d8
Now using Boostrap with LESS.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
152 } |
130eccd396d8
Now using Boostrap with LESS.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
153 |
130eccd396d8
Now using Boostrap with LESS.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
154 |
130eccd396d8
Now using Boostrap with LESS.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
155 /* APPLY TO STANDARD DROPDOWN ELEMENTS |
130eccd396d8
Now using Boostrap with LESS.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
156 * =================================== */ |
130eccd396d8
Now using Boostrap with LESS.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
157 |
130eccd396d8
Now using Boostrap with LESS.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
158 $(document) |
88 | 159 .on('click.dropdown.data-api', clearMenus) |
160 .on('click.dropdown.data-api', '.dropdown form', function (e) { e.stopPropagation() }) | |
161 .on('click.dropdown-menu', function (e) { e.stopPropagation() }) | |
162 .on('click.dropdown.data-api' , toggle, Dropdown.prototype.toggle) | |
163 .on('keydown.dropdown.data-api', toggle + ', [role=menu]' , Dropdown.prototype.keydown) | |
61
130eccd396d8
Now using Boostrap with LESS.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
164 |
88 | 165 }(window.jQuery); |