From 9a2efea4d9a7c1e8b936b0c8f7c37f8d74a87338 Mon Sep 17 00:00:00 2001 From: Julien Lancelot Date: Wed, 28 Aug 2013 12:58:59 +0200 Subject: [PATCH] SONAR-3524 Display a message when leaf is reached --- .../src/main/resources/org/sonar/l10n/core.properties | 2 +- .../WEB-INF/app/views/measures/_display_treemap.html.erb | 1 + sonar-server/src/main/webapp/javascripts/application.js | 4 +++- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/plugins/sonar-core-plugin/src/main/resources/org/sonar/l10n/core.properties b/plugins/sonar-core-plugin/src/main/resources/org/sonar/l10n/core.properties index cd4a4ca5da5..7e81970d664 100644 --- a/plugins/sonar-core-plugin/src/main/resources/org/sonar/l10n/core.properties +++ b/plugins/sonar-core-plugin/src/main/resources/org/sonar/l10n/core.properties @@ -1677,7 +1677,7 @@ bulk_deletion.delete_all_ghosts=Delete all ghosts # #------------------------------------------------------------------------------ treemap.click_help=Left click to zoom in. Right click to zoom out. - +treemap.bootom_level_reached=Zooming in is not possible as you have reached the bottom level #------------------------------------------------------------------------------ diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/measures/_display_treemap.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/measures/_display_treemap.html.erb index d886ae84746..20148674d41 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/views/measures/_display_treemap.html.erb +++ b/sonar-server/src/main/webapp/WEB-INF/app/views/measures/_display_treemap.html.erb @@ -18,6 +18,7 @@ <% end %> <%= image_tag 'loading-small.gif', :id => "tm-loading-#{treemap_id}", :style => 'display:none' -%> + diff --git a/sonar-server/src/main/webapp/javascripts/application.js b/sonar-server/src/main/webapp/javascripts/application.js index fb468cd78dc..42d5c35c41c 100644 --- a/sonar-server/src/main/webapp/javascripts/application.js +++ b/sonar-server/src/main/webapp/javascripts/application.js @@ -206,8 +206,9 @@ Treemap.prototype.load = function () { self.initNodes(); } else { // SONAR-3524 - // When data is empty, do not display it and revert breadcrumb state + // When data is empty, do not display it, revert breadcrumb state and display a message to user self.breadcrumb.pop(); + $j("#tm-bottom-level-reached-msg-" + self.id).show(); } $j("#tm-loading-" + self.id).hide(); } @@ -228,6 +229,7 @@ Treemap.prototype.initNodes = function () { $j(this).on("contextmenu", function (event) { event.stopPropagation(); event.preventDefault(); + $j("#tm-bottom-level-reached-msg-" + self.id).hide(); // right click if (self.breadcrumb.length > 1) { self.breadcrumb.pop(); -- 2.39.5