From 821f3eb23a7f75dd502c3aacbda5b69b04e247e1 Mon Sep 17 00:00:00 2001 From: pgrisu <42511852+pgrisu@users.noreply.github.com> Date: Mon, 22 Jul 2019 16:53:56 +0200 Subject: [PATCH 1/2] add support for optional widget title tooltip text --- ui/src/app/components/dashboard.directive.js | 11 +++++++++++ ui/src/app/components/dashboard.tpl.html | 6 +++++- .../app/components/widget/widget-config.directive.js | 4 +++- ui/src/app/components/widget/widget-config.tpl.html | 6 ++++++ ui/src/app/locale/locale.constant-de_DE.json | 1 + ui/src/app/locale/locale.constant-en_US.json | 1 + ui/src/app/locale/locale.constant-es_ES.json | 1 + ui/src/app/locale/locale.constant-fr_FR.json | 1 + ui/src/app/locale/locale.constant-it_IT.json | 1 + 9 files changed, 30 insertions(+), 2 deletions(-) diff --git a/ui/src/app/components/dashboard.directive.js b/ui/src/app/components/dashboard.directive.js index f748d52066..8cb7ce0167 100644 --- a/ui/src/app/components/dashboard.directive.js +++ b/ui/src/app/components/dashboard.directive.js @@ -187,6 +187,7 @@ function DashboardController($scope, $rootScope, $element, $timeout, $mdMedia, $ vm.showWidgetActions = showWidgetActions; vm.widgetTitleStyle = widgetTitleStyle; vm.widgetTitle = widgetTitle; + vm.widgetTitleTooltip = widgetTitleTooltip; vm.customWidgetHeaderActions = customWidgetHeaderActions; vm.widgetActions = widgetActions; vm.dropWidgetShadow = dropWidgetShadow; @@ -934,6 +935,16 @@ function DashboardController($scope, $rootScope, $element, $timeout, $mdMedia, $ } } + function widgetTitleTooltip(widget) { + var ctx = widgetContext(widget); + if (ctx && ctx.widgetTitleTooltip + && ctx.widgetTitleTooltip.length) { + return ctx.widgetTitleTooltip; + } else { + return widget.config.titleTooltip; + } + } + function customWidgetHeaderActions(widget) { var ctx = widgetContext(widget); if (ctx && ctx.customHeaderActions && ctx.customHeaderActions.length) { diff --git a/ui/src/app/components/dashboard.tpl.html b/ui/src/app/components/dashboard.tpl.html index 6687058216..40cdac4baf 100644 --- a/ui/src/app/components/dashboard.tpl.html +++ b/ui/src/app/components/dashboard.tpl.html @@ -47,7 +47,11 @@