diff options
author | Stas Vilchik <vilchiks@gmail.com> | 2015-09-21 10:45:22 +0200 |
---|---|---|
committer | Stas Vilchik <vilchiks@gmail.com> | 2015-09-21 10:45:28 +0200 |
commit | 02ffdbab9c11b9664ae5b168ab45e28a1fcd1b6a (patch) | |
tree | 5567228debd01feab0f16bbf9523fe79479f3571 | |
parent | 5de0cfcf35ccf85e5b7e78b27f156dc4d02750d6 (diff) | |
download | sonarqube-02ffdbab9c11b9664ae5b168ab45e28a1fcd1b6a.tar.gz sonarqube-02ffdbab9c11b9664ae5b168ab45e28a1fcd1b6a.zip |
SONAR-6160 apply feedback
7 files changed, 30 insertions, 6 deletions
diff --git a/server/sonar-web/src/main/js/apps/coding-rules/templates/coding-rules-workspace-header.hbs b/server/sonar-web/src/main/js/apps/coding-rules/templates/coding-rules-workspace-header.hbs index 6419abd452f..7076b1a06e1 100644 --- a/server/sonar-web/src/main/js/apps/coding-rules/templates/coding-rules-workspace-header.hbs +++ b/server/sonar-web/src/main/js/apps/coding-rules/templates/coding-rules-workspace-header.hbs @@ -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 diff --git a/server/sonar-web/src/main/js/apps/issues/templates/issues-workspace-header.hbs b/server/sonar-web/src/main/js/apps/issues/templates/issues-workspace-header.hbs index 163280ac9d9..c18b14a84b4 100644 --- a/server/sonar-web/src/main/js/apps/issues/templates/issues-workspace-header.hbs +++ b/server/sonar-web/src/main/js/apps/issues/templates/issues-workspace-header.hbs @@ -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"> diff --git a/server/sonar-web/src/main/js/apps/issues/workspace-list-view.js b/server/sonar-web/src/main/js/apps/issues/workspace-list-view.js index 3a4d2be2599..3fcccd1546f 100644 --- a/server/sonar-web/src/main/js/apps/issues/workspace-list-view.js +++ b/server/sonar-web/src/main/js/apps/issues/workspace-list-view.js @@ -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'], diff --git a/server/sonar-web/src/main/js/components/navigator/controller.js b/server/sonar-web/src/main/js/components/navigator/controller.js index b064a6d9570..89d8b6cc8d9 100644 --- a/server/sonar-web/src/main/js/components/navigator/controller.js +++ b/server/sonar-web/src/main/js/components/navigator/controller.js @@ -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'); } } diff --git a/server/sonar-web/src/main/js/components/navigator/workspace-header-view.js b/server/sonar-web/src/main/js/components/navigator/workspace-header-view.js index 57de675e340..2b88ab6d2aa 100644 --- a/server/sonar-web/src/main/js/components/navigator/workspace-header-view.js +++ b/server/sonar-web/src/main/js/components/navigator/workspace-header-view.js @@ -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() diff --git a/server/sonar-web/src/main/js/components/navigator/workspace-list-view.js b/server/sonar-web/src/main/js/components/navigator/workspace-list-view.js index 55a994f095e..01aaa035125 100644 --- a/server/sonar-web/src/main/js/components/navigator/workspace-list-view.js +++ b/server/sonar-web/src/main/js/components/navigator/workspace-list-view.js @@ -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) { diff --git a/server/sonar-web/src/main/less/components/ui.less b/server/sonar-web/src/main/less/components/ui.less index d50ddbc6d8d..6e8ebe364ef 100644 --- a/server/sonar-web/src/main/less/components/ui.less +++ b/server/sonar-web/src/main/less/components/ui.less @@ -216,3 +216,7 @@ background-color: #fcf8e3; } } + +.flash-heavy.in { + background-color: #ffe456; +} |