Add keyboard access for filters

This commit is contained in:
Alex Kilgour
2016-01-26 13:52:38 +00:00
parent baf73203e9
commit fd2dd62478
3 changed files with 213 additions and 192 deletions

View File

@@ -288,4 +288,25 @@ $(document).ready(function(){
});
}
// Extend public/js/vendor/bootstrap/js/collapse.js
// Add keyboard control for filters
$.fn.collapse.Constructor.prototype.keydown = function (e) {
var $this = $(this);
var k = e.which || e.keyCode;
if (!/(13|32)/.test(k)) {
return;
}
if (k === 13 || k === 32) {
$this.click();
}
e.preventDefault();
e.stopPropagation();
}
$('[data-toggle="collapse"]').attr('role', 'button').attr('tabindex', 0);
$(document).on('keydown.collapse.data-api', '[data-toggle="collapse"]' , $.fn.collapse.Constructor.prototype.keydown);
});

File diff suppressed because one or more lines are too long