aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStas Vilchik <vilchiks@gmail.com>2015-02-20 14:03:42 +0100
committerStas Vilchik <vilchiks@gmail.com>2015-02-20 14:03:42 +0100
commitb227895a78827fc705b845e50edb3bd8f02f4e8c (patch)
treee3c6ed392fe52bc75f114b840a9ee40706d786d1
parent8f47e3239171f42e9d73d4315ead88a1a47a0771 (diff)
downloadsonarqube-b227895a78827fc705b845e50edb3bd8f02f4e8c.tar.gz
sonarqube-b227895a78827fc705b845e50edb3bd8f02f4e8c.zip
fix quality flaws
-rw-r--r--server/sonar-web/src/main/js/application.js2
-rw-r--r--server/sonar-web/src/main/js/common/processes.js2
-rw-r--r--server/sonar-web/src/main/js/navigator/filters/ajax-select-filters.js13
-rw-r--r--server/sonar-web/src/main/js/navigator/filters/choice-filters.js13
-rw-r--r--server/sonar-web/src/main/js/navigator/filters/filter-bar.js26
5 files changed, 28 insertions, 28 deletions
diff --git a/server/sonar-web/src/main/js/application.js b/server/sonar-web/src/main/js/application.js
index e8e1deff560..601a0ac8712 100644
--- a/server/sonar-web/src/main/js/application.js
+++ b/server/sonar-web/src/main/js/application.js
@@ -168,8 +168,6 @@ function openModalWindow(url, options) {
}
});
$dialog.dialog('open');
- }).fail(function () {
- alert('Server error. Please contact your administrator.');
}).always(function () {
$dialog.removeClass('ui-widget-overlay');
});
diff --git a/server/sonar-web/src/main/js/common/processes.js b/server/sonar-web/src/main/js/common/processes.js
index 19bc593c39a..52250ff5b7c 100644
--- a/server/sonar-web/src/main/js/common/processes.js
+++ b/server/sonar-web/src/main/js/common/processes.js
@@ -69,6 +69,8 @@
case 'finished':
this.$el.addClass('hidden');
break;
+ default:
+ break;
}
return this;
}
diff --git a/server/sonar-web/src/main/js/navigator/filters/ajax-select-filters.js b/server/sonar-web/src/main/js/navigator/filters/ajax-select-filters.js
index 9cdd894ecd8..7baad106a99 100644
--- a/server/sonar-web/src/main/js/navigator/filters/ajax-select-filters.js
+++ b/server/sonar-web/src/main/js/navigator/filters/ajax-select-filters.js
@@ -238,12 +238,13 @@ define([
_.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;
}
}
});
diff --git a/server/sonar-web/src/main/js/navigator/filters/choice-filters.js b/server/sonar-web/src/main/js/navigator/filters/choice-filters.js
index 1919b7dcd53..b329c660572 100644
--- a/server/sonar-web/src/main/js/navigator/filters/choice-filters.js
+++ b/server/sonar-web/src/main/js/navigator/filters/choice-filters.js
@@ -281,12 +281,13 @@ define([
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');
}
}
});
diff --git a/server/sonar-web/src/main/js/navigator/filters/filter-bar.js b/server/sonar-web/src/main/js/navigator/filters/filter-bar.js
index 4d8d35e0138..36939f15d0c 100644
--- a/server/sonar-web/src/main/js/navigator/filters/filter-bar.js
+++ b/server/sonar-web/src/main/js/navigator/filters/filter-bar.js
@@ -37,23 +37,21 @@ define(
});
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');