selectCurrent: function() {
- this.$('label').eq(this.currentChoice).click();
+ var cb = this.$('input[type=checkbox]').eq(this.currentChoice);
+ cb.prop('checked', !cb.prop('checked')).trigger('change');
},
key.filter = function(e) {
var el = jQuery(e.target),
tabbableSet = el.closest('.navigator-filter-details-inner').find(':tabbable');
- return tabbableSet.index(el) >= tabbableSet.length - 1;
+ if (el.is(':input')) {
+ if (e.keyCode === 9 || e.keyCode === 27) {
+ return tabbableSet.index(el) >= tabbableSet.length - 1;
+ } else {
+ return false;
+ }
+ } else {
+ return true;
+ }
};
- key('f', function() {
+ key('tab', 'list', function() {
key.setScope('filters');
that.selectFirst();
return false;
that.selectNext();
return false;
});
+ key('escape', 'filters', function() {
+ that.hideDetails();
+ this.selected = -1;
+ key.setScope('list');
+ });
},
this.selected++;
filters.eq(this.selected).click();
} else {
+ this.selected = filters.length;
this.hideDetails();
this.$('.navigator-filter-submit').focus();
}
},
+ selectCurrent: function() {
+ this.$('label').eq(this.currentChoice).click();
+ },
+
+
serializeData: function() {
var filters = this.model.get('filters').map(function(filter) {
return _.extend(filter.toJSON(), { id: filter.cid });