]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-6160 apply feedback
authorStas Vilchik <vilchiks@gmail.com>
Mon, 21 Sep 2015 08:45:22 +0000 (10:45 +0200)
committerStas Vilchik <vilchiks@gmail.com>
Mon, 21 Sep 2015 08:45:28 +0000 (10:45 +0200)
server/sonar-web/src/main/js/apps/coding-rules/templates/coding-rules-workspace-header.hbs
server/sonar-web/src/main/js/apps/issues/templates/issues-workspace-header.hbs
server/sonar-web/src/main/js/apps/issues/workspace-list-view.js
server/sonar-web/src/main/js/components/navigator/controller.js
server/sonar-web/src/main/js/components/navigator/workspace-header-view.js
server/sonar-web/src/main/js/components/navigator/workspace-list-view.js
server/sonar-web/src/main/less/components/ui.less

index 6419abd452f595a9749ae865d2e145b2963704cd..7076b1a06e197016e9345811bd39972c496c654e 100644 (file)
@@ -9,7 +9,7 @@
 
 <div class="search-navigator-header-actions">
   {{#notNull state.total}}
-    <div class="search-navigator-header-pagination">
+    <div class="search-navigator-header-pagination flash flash-heavy">
       {{#gt state.total 0}}
         <a class="js-prev icon-prev" title="{{t 'paging_previous'}}"></a>
         <span class="current">{{sum state.selectedIndex 1}} / <span
index 163280ac9d919fc23ce2ed71fdf9d13b5cb33d17..c18b14a84b4587bce107df251d30c882298da396 100644 (file)
@@ -34,7 +34,7 @@
 
 <div class="search-navigator-header-actions">
   {{#notNull state.total}}
-    <div class="search-navigator-header-pagination">
+    <div class="search-navigator-header-pagination flash flash-heavy">
       {{#gt state.total 0}}
         <a class="js-prev icon-prev" title="{{t "paging_previous"}}"></a>
         <span class="current">
index 3a4d2be2599f522479d442c6a78d2303c60b2962..3fcccd1546f83d0626c19a4162b75359f2d2f5f6 100644 (file)
@@ -5,7 +5,7 @@ import EmptyView from './workspace-list-empty-view';
 import './templates';
 
 var COMPONENT_HEIGHT = 29,
-    BOTTOM_OFFSET = 10;
+    BOTTOM_OFFSET = 60;
 
 export default WorkspaceListView.extend({
   template: Templates['issues-workspace-list'],
index b064a6d9570e6852c52e3ce34719e6dda76748cd..89d8b6cc8d9e3e651d43b37c72dd55407678ec44 100644 (file)
@@ -117,6 +117,8 @@ define(function () {
           this.fetchNextPage().done(function () {
             that.options.app.state.set({ selectedIndex: index });
           });
+        } else {
+          this.options.app.list.trigger('limitReached');
         }
       }
     },
@@ -125,6 +127,8 @@ define(function () {
       var index = this.options.app.state.get('selectedIndex') - 1;
       if (index >= 0) {
         this.options.app.state.set({ selectedIndex: index });
+      } else {
+        this.options.app.list.trigger('limitReached');
       }
     }
 
index 57de675e340b0a5f57e925a133a8d09ee1860d22..2b88ab6d2aa6e08a1095e2277641a5e6a282c3cf 100644 (file)
@@ -4,7 +4,8 @@ define(function () {
 
     collectionEvents: function () {
       return {
-        'all': 'render'
+        'all': 'shouldRender',
+        'limitReached': 'flashPagination'
       };
     },
 
@@ -42,6 +43,12 @@ define(function () {
 
     },
 
+    shouldRender: function (event) {
+      if (event !== 'limitReached') {
+        this.render();
+      }
+    },
+
     reload: function () {
       this.options.app.controller.fetchList();
     },
@@ -54,6 +61,14 @@ define(function () {
       this.options.app.controller.selectPrev();
     },
 
+    flashPagination: function () {
+      var flashElement = this.$('.search-navigator-header-pagination');
+      flashElement.addClass('in');
+      setTimeout(function () {
+        flashElement.removeClass('in');
+      }, 2000);
+    },
+
     serializeData: function () {
       return _.extend(Marionette.ItemView.prototype.serializeData.apply(this, arguments), {
         state: this.options.app.state.toJSON()
index 55a994f095edfd5579cbdb0367d82f97af8fbbc1..01aaa0351255b8f597a3d7493312326afa65e420 100644 (file)
@@ -1,6 +1,7 @@
 define(function () {
 
-  var $ = jQuery;
+  var $ = jQuery,
+      BOTTOM_OFFSET = 60;
 
   return Marionette.CompositeView.extend({
 
@@ -93,7 +94,7 @@ define(function () {
       var selectedView = this.children.findByModel(selected),
           parentTopOffset = this.$el.offset().top,
           viewTop = selectedView.$el.offset().top - parentTopOffset,
-          viewBottom = selectedView.$el.offset().top + selectedView.$el.outerHeight(),
+          viewBottom = selectedView.$el.offset().top + selectedView.$el.outerHeight() + BOTTOM_OFFSET,
           windowTop = $(window).scrollTop(),
           windowBottom = windowTop + $(window).height();
       if (viewTop < windowTop) {
index d50ddbc6d8d46ce427555bfaac06a136b4189eb4..6e8ebe364ef51218d8900565d014da5306e7dffa 100644 (file)
     background-color: #fcf8e3;
   }
 }
+
+.flash-heavy.in {
+  background-color: #ffe456;
+}