From 2d74e2414836ee0b9c8db3e3239dece7ff7c7af6 Mon Sep 17 00:00:00 2001 From: Stas Vilchik Date: Wed, 18 Nov 2015 16:56:59 +0100 Subject: [PATCH] SONAR-6924 Add a tooltip with a component key for each search entry --- .../src/main/js/main/nav/global/search-view.js | 13 +++++++++++++ .../main/js/main/nav/templates/nav-search-item.hbs | 2 +- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/server/sonar-web/src/main/js/main/nav/global/search-view.js b/server/sonar-web/src/main/js/main/nav/global/search-view.js index deffefb3942..65a3a4a7740 100644 --- a/server/sonar-web/src/main/js/main/nav/global/search-view.js +++ b/server/sonar-web/src/main/js/main/nav/global/search-view.js @@ -24,6 +24,19 @@ var SearchItemView = Marionette.ItemView.extend({ this.$('a')[0].click(); }, + onRender: function () { + this.$('[data-toggle="tooltip"]').tooltip({ + container: 'body', + html: true, + placement: 'left', + delay: { show: 500, hide: 0 } + }); + }, + + onDestroy: function () { + this.$('[data-toggle="tooltip"]').tooltip('destroy'); + }, + serializeData: function () { return _.extend(Marionette.ItemView.prototype.serializeData.apply(this, arguments), { index: this.options.index diff --git a/server/sonar-web/src/main/js/main/nav/templates/nav-search-item.hbs b/server/sonar-web/src/main/js/main/nav/templates/nav-search-item.hbs index 855b5175187..cc04651dfb7 100644 --- a/server/sonar-web/src/main/js/main/nav/templates/nav-search-item.hbs +++ b/server/sonar-web/src/main/js/main/nav/templates/nav-search-item.hbs @@ -7,7 +7,7 @@ {{/if}} {{/notNull}} - + {{#if icon}}{{/if}} {{#if q}}{{qualifierIcon q}}{{/if}} {{#eq q 'FIL'}} -- 2.39.5