_.each(this.model.get('choices'), function(v, k) {
if (k[0] === '!') {
var x = _.findWhere(q, { key: k.substr(1) });
- if (x) {
- if (!param) {
- param = { value: k };
- } else {
- param.value += ',' + k;
- }
+ if (x == null) {
+ return;
+ }
+ if (!param) {
+ param = { value: k };
+ } else {
+ param.value += ',' + k;
}
}
});
var value = item.get('id').split('=')[1];
x = _.findWhere(q, { key: key, value: value });
}
- if (x) {
- if (!param) {
- param = { value: item.get('id') };
- } else {
- param.value += ',' + item.get('id');
- }
+ if (x == null) {
+ return;
+ }
+ if (!param) {
+ param = { value: item.get('id') };
+ } else {
+ param.value += ',' + item.get('id');
}
}
});
});
this.addMoreCriteriaFilter();
- key.filter = function(e) {
- var el = jQuery(e.target),
+ key.filter = function (e) {
+ var r = true,
+ el = jQuery(e.target),
box = el.closest('.navigator-filter-details-inner'),
- tabbableSet = box.find(':tabbable');
-
- if (el.closest('.ui-dialog').length > 0 && (el.is(':input') || el.is('a'))) {
- return false;
- }
-
- if (el.is(':input') || el.is('a')) {
- if (e.keyCode === 9 || e.keyCode === 27) {
- return tabbableSet.index(el) >= tabbableSet.length - 1;
+ tabbableSet = box.find(':tabbable'),
+ isElFocusable = el.is(':input') || el.is('a'),
+ isInsideDialog = el.closest('.ui-dialog').length > 0;
+ if (isElFocusable) {
+ if (!isInsideDialog && (e.keyCode === 9 || e.keyCode === 27)) {
+ r = tabbableSet.index(el) >= tabbableSet.length - 1;
+ } else {
+ r = false;
}
- return false;
}
-
- return true;
+ return r;
};
key('tab', 'list', function() {
key.setScope('filters');