1
0
mirror of https://github.com/twbs/bootstrap.git synced 2025-10-02 16:28:26 +02:00

more grunt

This commit is contained in:
Mark Otto
2015-08-18 20:28:45 -07:00
parent 9ccf308fd1
commit 6211641f69
16 changed files with 179 additions and 116 deletions

View File

@@ -99,7 +99,7 @@
value: function toggle() {
if (this.disabled || $(this).hasClass(ClassName.DISABLED)) {
return;
return false;
}
var parent = Dropdown._getParentFromElement(this);
@@ -126,7 +126,7 @@
$(parent).trigger(showEvent);
if (showEvent.isDefaultPrevented()) {
return;
return false;
}
this.focus();
@@ -259,9 +259,19 @@
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();
}