]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-5078 Fix different issues of new design
authorStas Vilchik <vilchiks@gmail.com>
Fri, 11 Apr 2014 07:24:32 +0000 (13:24 +0600)
committerStas Vilchik <vilchiks@gmail.com>
Fri, 11 Apr 2014 07:24:32 +0000 (13:24 +0600)
sonar-server/src/main/coffee/coding-rules/views/coding-rules-bulk-change-dropdown-view.coffee
sonar-server/src/main/js/issues/app.js
sonar-server/src/main/js/issues/extra.js
sonar-server/src/main/less/coding-rules.less
sonar-server/src/main/less/navigator/base.less
sonar-server/src/main/less/navigator/filters.less
sonar-server/src/main/webapp/WEB-INF/app/views/issues/search.html.erb
sonar-server/src/main/webapp/WEB-INF/app/views/issues/templates/_issues.hbs.erb [new file with mode: 0644]

index 3353b9ccc4c4122ca59c96f13916008313271013..3edc4c8423f696764e35449690757f32e0671378 100644 (file)
@@ -31,6 +31,9 @@ define [
     onRender: ->
       jQuery('body').append @el
       jQuery('body').off('click.bulk-change').on 'click.bulk-change', => @hide()
+      @$el.css
+        top: jQuery('.navigator-actions').offset().top + jQuery('.navigator-actions').height() + 1
+        left: jQuery('.navigator-actions').offset().left + jQuery('.navigator-actions').outerWidth() - @$el.outerWidth()
 
 
     toggle: ->
index 26543828640e49d3c6d48c713aff80d5cf10fd9b..f2a6d04068ba11c9023c6fea9c43cac79858617b 100644 (file)
@@ -312,6 +312,13 @@ requirejs(
               detailsHeight = jQuery(window).height() - detailsEl.offset().top -
                   parseInt(detailsEl.css('margin-bottom'), 10) - footerHeight;
           detailsEl.width(detailsWidth).height(detailsHeight);
+
+          var resultsLoadingEl = jQuery('.navigator-results-loader');
+          resultsLoadingEl
+              .css('top', resultsEl.offset().top)
+              .css('left', resultsEl.offset().left)
+              .width(resultsEl.width() + 10)
+              .height(resultsEl.height() + 10);
         };
         jQuery(window).on('resize', this.onResize);
         this.onResize();
@@ -329,6 +336,7 @@ requirejs(
         if (resultsWidth) {
           jQuery('.navigator-results').width(+resultsWidth);
           jQuery('.navigator-side').width(+resultsWidth + 20);
+          this.onResize();
         }
       });
 
@@ -428,12 +436,12 @@ requirejs(
         this.storeQuery(query, this.issues.sorting);
 
         var that = this;
-        this.issuesView.$el.addClass('navigator-fetching');
+        jQuery('.navigator-results').addClass('fetching');
         if (firstPage) {
           this.issues.fetch({
             data: fetchQuery,
             success: function () {
-              that.issuesView.$el.removeClass('navigator-fetching');
+              jQuery('.navigator-results').removeClass('fetching');
               that.issuesView.selectFirst();
             }
           });
@@ -443,7 +451,7 @@ requirejs(
             data: fetchQuery,
             remove: false,
             success: function () {
-              that.issuesView.$el.removeClass('navigator-fetching');
+              jQuery('.navigator-results').removeClass('fetching');
             }
           });
         }
index 0d83417e8c6b3e5b9aff870412b6629d6c6aa06d..9b5f92376b31bd129b5ff3864aba371c0affe589 100644 (file)
@@ -237,16 +237,16 @@ define(
       });
 
 
-      var IssuesView = Marionette.CollectionView.extend({
-        tagName: 'ol',
-        className: 'navigator-results-list',
+      var IssuesView = Marionette.CompositeView.extend({
+        template: Handlebars.compile(jQuery('#issues-template').html() || ''),
+        itemViewContainer: '.navigator-results-list',
         itemView: IssueView,
         emptyView: NoIssuesView,
 
 
         initialize: function() {
           var openIssue = function(el) { el.click(); };
-          this.openRule = _.debounce(openIssue, 300);
+          this.openIssue = _.debounce(openIssue, 300);
         },
 
 
@@ -262,7 +262,7 @@ define(
           this.$('.active').removeClass('active');
           el.addClass('active');
           if (open) {
-            this.openRule(el);
+            this.openIssue(el);
           }
         },
 
@@ -276,7 +276,7 @@ define(
         selectNext: function() {
           if (this.selected < this.collection.length - 1) {
             this.selected++;
-            var child = this.$el.children().eq(this.selected),
+            var child = this.$(this.itemViewContainer).children().eq(this.selected),
                 container = jQuery('.navigator-results'),
                 containerHeight = container.height(),
                 bottom = child.position().top + child.outerHeight();
index 359c2737498be65b697a7d6bc02d49f8d89e5774..a3c2eabc92f15b94fe28f73f0a1f23c1a3799939 100644 (file)
 
 // Bulk Change
 .coding-rules-bulk-change-dropdown {
-  position: fixed;
+  position: absolute;
   z-index: 10;
-  top: @navigatorTopOffset + @navigatorHeaderHeight + @navigatorFiltersHeight + @navigatorFacetsHeight + @navigatorStatusHeight - 1px;
-  left: @navigatorResultsWidth - 200px;
   width: 200px;
   border: 1px solid @navigatorBorderLightColor;
   .box-sizing(border-box);
index ca6ded4c1e9125d300d97337421b795ba282a94e..a7f71937a96c8c7955de64c2ff1b2a0def5a161a 100644 (file)
 
 // Notes
 .navigator-notes {
-  margin: 0 @navigatorPadding @navigatorPadding 0;
+  margin: 0 @navigatorPadding @navigatorPadding @navigatorPadding;
   padding: 0 @navigatorPadding;
   border: 1px solid @navigatorBorderColor;
   background-color: @navigatorBarBackground;
   background-color: @white;
   overflow-x: hidden;
   overflow-y: auto;
+
+  &.fetching {
+    .navigator-results-list { visibility: hidden; }
+    .navigator-results-loader { display: block; }
+  }
+}
+
+.navigator-results-loader {
+  position: fixed;
+  z-index: 10;
+  display: none;
+  background-color: #fff;
 }
 
 .navigator-results-list {
   }
 
   & > li + li { margin-top: -1px; }
-
-  &.navigator-fetching {
-
-    & > li .line-nowrap {
-      text-overflow: clip; /* thanks to FF */
-    }
-
-    &:before {
-      position: absolute;
-      z-index: 3;
-      top: 0; bottom: 0; left: 0; right: 0;
-    }
-  }
 }
 
 .navigator-results-no-results {
index 47912285bc17759788fa9a94c48ddb90d1f8f560..918003a0e8648a2b6a29dae28641ce6458dbf271 100644 (file)
 
 .navigator-filter-submit {
   position: absolute;
-  top: 0; right: 0;
-  .size(85px, 100%);
+  bottom: 0; right: 0;
+  .size(85px, @navigatorFiltersHeight);
   margin: -1px -1px -1px 0;
   padding: 0;
   border: 1px solid darken(@blue, 10%);
-  .box-sizing(content-box);
   background: @blue;
   color: #fff;
   font-weight: normal;
index 385c8517c4eb73321d3cd636e6adecbb9b50db8d..0962c0f660dcae61ea471b6705f00c45c43a41aa 100644 (file)
@@ -26,6 +26,7 @@
 <%= render :partial => '/issues/templates/header.hbs' -%>
 <%= render :partial => '/issues/templates/issue.hbs' -%>
 <%= render :partial => '/issues/templates/issues_actions.hbs' -%>
+<%= render :partial => '/issues/templates/issues.hbs' -%>
 <%= render :partial => '/issues/templates/no_issues.hbs' -%>
 <%= render :partial => '/issues/templates/issues_details_favorite_filter.hbs' -%>
 <%= render :partial => '/issues/templates/issue_detail.hbs' -%>
diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/issues/templates/_issues.hbs.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/issues/templates/_issues.hbs.erb
new file mode 100644 (file)
index 0000000..a4c8b45
--- /dev/null
@@ -0,0 +1,6 @@
+<script id="issues-template" type="text/x-handlebars-template">
+  <ol class="navigator-results-list"></ol>
+  <div class="navigator-results-loader">
+    <i class="spinner"></i>
+  </div>
+</script>