From 64d6fb22f003fecc6d08111a8c54ca2cb5afcd15 Mon Sep 17 00:00:00 2001 From: Julien Lancelot Date: Wed, 21 Aug 2013 12:18:48 +0200 Subject: [PATCH] Revert "SONAR-3524 Impossible to go back on empty treemap" This reverts commit 668c03e9d570c5a5800c0db2092251bb26a9933f. --- .../main/webapp/javascripts/application.js | 54 ++++++++----------- 1 file changed, 22 insertions(+), 32 deletions(-) diff --git a/sonar-server/src/main/webapp/javascripts/application.js b/sonar-server/src/main/webapp/javascripts/application.js index 4dd69d27b1d..501fd589a24 100644 --- a/sonar-server/src/main/webapp/javascripts/application.js +++ b/sonar-server/src/main/webapp/javascripts/application.js @@ -213,48 +213,38 @@ Treemap.prototype.rootNode = function () { Treemap.prototype.initNodes = function () { var self = this; - console.log(this); $j('#tm-' + this.id).find('a').each(function (index) { $j(this).on("click", function (event) { event.stopPropagation(); }); }); - if ($j('#tm-' + this.id).is(':empty')){ - // SONAR-3524 - // If the content is empty, then the right click should lead to return to the parent (will in fact reload the page) - $j('#tm-' + this.id).on("contextmenu", function (event) { - location.reload(); + $j('#tm-' + this.id).find('[rid]').each(function (index) { + $j(this).on("contextmenu", function (event) { + event.stopPropagation(); + event.preventDefault(); + // right click + if (self.breadcrumb.length > 1) { + self.breadcrumb.pop(); + self.load(); + } else if (self.breadcrumb.length == 1) { + $j("#tm-loading-" + self.id).show(); + location.reload(); + } return false; }); - } else { - $j('#tm-' + this.id).find('[rid]').each(function (index) { - $j(this).on("contextmenu", function (event) { - event.stopPropagation(); - event.preventDefault(); - // right click - if (self.breadcrumb.length > 1) { - self.breadcrumb.pop(); + $j(this).on("click", function (event) { + var source = $j(this); + var rid = source.attr('rid'); + var has_leaves = !!(source.attr('l')); + if (!has_leaves) { + var context = new TreemapContext(rid, source.text()); + self.breadcrumb.push(context); self.load(); - } else if (self.breadcrumb.length == 1) { - $j("#tm-loading-" + self.id).show(); - location.reload(); } - return false; - }); - $j(this).on("click", function (event) { - var source = $j(this); - var rid = source.attr('rid'); - var has_leaves = !!(source.attr('l')); - if (!has_leaves) { - var context = new TreemapContext(rid, source.text()); - self.breadcrumb.push(context); - self.load(); - } - } - ); - }); - } + } + ); + }); }; function openModalWindow(url, options) { -- 2.39.5