mirror of
https://github.com/twbs/bootstrap.git
synced 2025-08-10 23:54:08 +02:00
js grunt
This commit is contained in:
20
js/dist/dropdown.js
vendored
20
js/dist/dropdown.js
vendored
@@ -82,7 +82,7 @@ var Dropdown = (function ($) {
|
||||
|
||||
value: function toggle() {
|
||||
if (this.disabled || $(this).hasClass(ClassName.DISABLED)) {
|
||||
return;
|
||||
return false;
|
||||
}
|
||||
|
||||
var parent = Dropdown._getParentFromElement(this);
|
||||
@@ -109,7 +109,7 @@ var Dropdown = (function ($) {
|
||||
$(parent).trigger(showEvent);
|
||||
|
||||
if (showEvent.isDefaultPrevented()) {
|
||||
return;
|
||||
return false;
|
||||
}
|
||||
|
||||
this.focus();
|
||||
@@ -242,9 +242,19 @@ var Dropdown = (function ($) {
|
||||
|
||||
var index = items.indexOf(event.target);
|
||||
|
||||
if (event.which === 38 && index > 0) index--; // up
|
||||
if (event.which === 40 && index < items.length - 1) index++; // down
|
||||
if (! ~index) index = 0;
|
||||
if (event.which === 38 && index > 0) {
|
||||
// up
|
||||
index--;
|
||||
}
|
||||
|
||||
if (event.which === 40 && index < items.length - 1) {
|
||||
// down
|
||||
index++;
|
||||
}
|
||||
|
||||
if (! ~index) {
|
||||
index = 0;
|
||||
}
|
||||
|
||||
items[index].focus();
|
||||
}
|
||||
|
Reference in New Issue
Block a user