]> source.dussan.org Git - sonarqube.git/commitdiff
fix quality flaws
authorStas Vilchik <vilchiks@gmail.com>
Fri, 20 Feb 2015 13:03:42 +0000 (14:03 +0100)
committerStas Vilchik <vilchiks@gmail.com>
Fri, 20 Feb 2015 13:03:42 +0000 (14:03 +0100)
server/sonar-web/src/main/js/application.js
server/sonar-web/src/main/js/common/processes.js
server/sonar-web/src/main/js/navigator/filters/ajax-select-filters.js
server/sonar-web/src/main/js/navigator/filters/choice-filters.js
server/sonar-web/src/main/js/navigator/filters/filter-bar.js

index e8e1deff560bc43c64272cf009f3dbfb6a7e8cc2..601a0ac87123587c6a930b96e3a69c6ea3a29b60 100644 (file)
@@ -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');
   });
index 19bc593c39a1e0d7c91243f0f3f867b18422ad58..52250ff5b7cf6a4099a449b559595bb41a624f62 100644 (file)
@@ -69,6 +69,8 @@
             case 'finished':
               this.$el.addClass('hidden');
               break;
+            default:
+              break;
           }
           return this;
         }
index 9cdd894ecd838d52cadfe3a9868dc06f00695223..7baad106a991e2aa6e890b52d45e574d93ad0527 100644 (file)
@@ -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;
             }
           }
         });
index 1919b7dcd53d9841ee8dc97b79aa247066cae5cb..b329c6605720da120c4201224ef507a51b2ee8f8 100644 (file)
@@ -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');
             }
           }
         });
index 4d8d35e01385ea6a4aa98726dc240ce23536a891..36939f15d0c2a559f176ebaaade0b621afe028c4 100644 (file)
@@ -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');