vendor/assets/javascripts/dropdown.js in flashgrid-3.1.0 vs vendor/assets/javascripts/dropdown.js in flashgrid-3.1.1

- old
+ new

@@ -44,11 +44,11 @@ return false } Dropdown.prototype.keydown = function (e) { - if (!/(38|40|27)/.test(e.keyCode)) return + if (!/(38|40|27|32)/.test(e.which)) return var $this = $(this) e.preventDefault() e.stopPropagation() @@ -56,11 +56,11 @@ if ($this.is('.disabled, :disabled')) return var $parent = getParent($this) var isActive = $parent.hasClass('open') - if (!isActive || (isActive && e.keyCode == 27)) { + if ((!isActive && e.which != 27) || (isActive && e.which == 27)) { if (e.which == 27) $parent.find(toggle).trigger('focus') return $this.trigger('click') } var desc = ' li:not(.divider):visible a' @@ -68,11 +68,11 @@ if (!$items.length) return var index = $items.index($items.filter(':focus')) - if (e.keyCode == 38 && index > 0) index-- // up - if (e.keyCode == 40 && index < $items.length - 1) index++ // down + if (e.which == 38 && index > 0) index-- // up + if (e.which == 40 && index < $items.length - 1) index++ // down if (!~index) index = 0 $items.eq(index).trigger('focus') } \ No newline at end of file