Commit cae12002c8f7e20f15a8f2ad0e5313a789a2695d

Authored by Igor Kulikov
2 parents 2cc6203c 4299869a

Fix conflicts

... ... @@ -190,6 +190,7 @@ function DashboardController($scope, $rootScope, $element, $timeout, $mdMedia, $
190 190 vm.widgetTitle = widgetTitle;
191 191 vm.widgetTitleIcon = widgetTitleIcon;
192 192 vm.widgetTitleIconStyle = widgetTitleIconStyle;
  193 + vm.widgetTitleTooltip = widgetTitleTooltip;
193 194 vm.customWidgetHeaderActions = customWidgetHeaderActions;
194 195 vm.widgetActions = widgetActions;
195 196 vm.dropWidgetShadow = dropWidgetShadow;
... ... @@ -964,6 +965,16 @@ function DashboardController($scope, $rootScope, $element, $timeout, $mdMedia, $
964 965 return style;
965 966 }
966 967
  968 + function widgetTitleTooltip(widget) {
  969 + var ctx = widgetContext(widget);
  970 + if (ctx && ctx.widgetTitleTooltip
  971 + && ctx.widgetTitleTooltip.length) {
  972 + return ctx.widgetTitleTooltip;
  973 + } else {
  974 + return widget.config.titleTooltip;
  975 + }
  976 + }
  977 +
967 978 function customWidgetHeaderActions(widget) {
968 979 var ctx = widgetContext(widget);
969 980 if (ctx && ctx.customHeaderActions && ctx.customHeaderActions.length) {
... ...
... ... @@ -52,6 +52,9 @@
52 52 {{vm.widgetTitleIcon(widget)}}
53 53 </md-icon>
54 54 {{vm.widgetTitle(widget)}}
  55 + <md-tooltip class="tb-tooltip-multiline" ng-if="vm.widgetTitleTooltip(widget)" md-direction="{{vm.isWidgetExpanded ? 'bottom' : 'top'}}">
  56 + <span ng-bind-html="vm.widgetTitleTooltip(widget)"></span>
  57 + </md-tooltip>
55 58 </span>
56 59 <tb-timewindow aggregation="{{vm.hasAggregation(widget)}}" ng-if="vm.hasTimewindow(widget)" ng-model="widget.config.timewindow"></tb-timewindow>
57 60 </div>
... ...
... ... @@ -113,6 +113,7 @@ function WidgetConfig($compile, $templateCache, $rootScope, $translate, $timeout
113 113 scope.titleIcon = angular.isDefined(config.titleIcon) ? config.titleIcon : '';
114 114 scope.iconColor = angular.isDefined(config.iconColor) ? config.iconColor : 'rgba(0, 0, 0, 0.87)';
115 115 scope.iconSize = angular.isDefined(config.iconSize) ? config.iconSize : '24px';
  116 + scope.titleTooltip = angular.isDefined(config.titleTooltip) ? config.titleTooltip : '';
116 117 scope.showTitle = config.showTitle;
117 118 scope.dropShadow = angular.isDefined(config.dropShadow) ? config.dropShadow : true;
118 119 scope.enableFullscreen = angular.isDefined(config.enableFullscreen) ? config.enableFullscreen : true;
... ... @@ -240,7 +241,7 @@ function WidgetConfig($compile, $templateCache, $rootScope, $translate, $timeout
240 241 }
241 242 };
242 243
243   - scope.$watch('title + showTitleIcon + titleIcon + iconColor + iconSize + showTitle + dropShadow + enableFullscreen + backgroundColor + ' +
  244 + scope.$watch('title + showTitleIcon + titleIcon + iconColor + iconSize + titleTooltip + showTitle + dropShadow + enableFullscreen + backgroundColor + ' +
244 245 'color + padding + margin + widgetStyle + titleStyle + mobileOrder + mobileHeight + units + decimals + useDashboardTimewindow + ' +
245 246 'displayTimewindow + alarmSearchStatus + alarmsPollingInterval + showLegend', function () {
246 247 if (ngModelCtrl.$viewValue) {
... ... @@ -252,6 +253,7 @@ function WidgetConfig($compile, $templateCache, $rootScope, $translate, $timeout
252 253 config.titleIcon = scope.titleIcon;
253 254 config.iconColor = scope.iconColor;
254 255 config.iconSize = scope.iconSize;
  256 + config.titleTooltip = scope.titleTooltip;
255 257 config.showTitle = scope.showTitle;
256 258 config.dropShadow = scope.dropShadow;
257 259 config.enableFullscreen = scope.enableFullscreen;
... ...
... ... @@ -215,6 +215,10 @@
215 215 <label translate>widget-config.icon-size</label>
216 216 <input ng-model="iconSize">
217 217 </md-input-container>
  218 + <md-input-container flex class="md-block">
  219 + <label translate>widget-config.title-tooltip</label>
  220 + <input name="titleTooltip" ng-model="titleTooltip">
  221 + </md-input-container>
218 222 </div>
219 223 <div layout='column' layout-align="center" layout-gt-sm='row' layout-align-gt-sm="start center">
220 224 <div layout="row" layout-padding>
... ...
... ... @@ -1498,6 +1498,7 @@
1498 1498 "settings": "Einstellungen",
1499 1499 "advanced": "Erweitert ",
1500 1500 "title": "Titel",
  1501 + "title-tooltip": "Titel Tooltip",
1501 1502 "general-settings": "Allgemeine Einstellungen",
1502 1503 "display-title": "Titel anzeigen",
1503 1504 "drop-shadow": "Schlagschatten",
... ...
... ... @@ -1569,6 +1569,7 @@
1569 1569 "settings": "Settings",
1570 1570 "advanced": "Advanced",
1571 1571 "title": "Title",
  1572 + "title-tooltip": "Title Tooltip",
1572 1573 "general-settings": "General settings",
1573 1574 "display-title": "Display title",
1574 1575 "drop-shadow": "Drop shadow",
... ...
... ... @@ -1568,6 +1568,7 @@
1568 1568 "settings": "Configuración",
1569 1569 "advanced": "Avanzado",
1570 1570 "title": "Título",
  1571 + "title-tooltip": "Tooltip Título",
1571 1572 "general-settings": "Configuración general",
1572 1573 "display-title": "Mostrar título",
1573 1574 "drop-shadow": "Colocar sombra",
... ...
... ... @@ -1429,6 +1429,7 @@
1429 1429 "timewindow": "Fenêtre de temps",
1430 1430 "title": "Titre",
1431 1431 "title-style": "Style de titre",
  1432 + "title-tooltip": "Tooltip de titre",
1432 1433 "units": "Symbole spécial à afficher à côté de la valeur",
1433 1434 "use-dashboard-timewindow": "Utiliser la fenêtre de temps du tableau de bord",
1434 1435 "widget-style": "Style du widget",
... ...
... ... @@ -1503,6 +1503,7 @@
1503 1503 "settings": "Impostazioni",
1504 1504 "advanced": "Avanzate",
1505 1505 "title": "Titolo",
  1506 + "title-tooltip": "Tooltip titolo",
1506 1507 "general-settings": "Impostazioni generali",
1507 1508 "display-title": "Mostra titolo",
1508 1509 "drop-shadow": "Drop shadow",
... ...
... ... @@ -483,6 +483,15 @@ pre.tb-highlight {
483 483 @include line-clamp(2, 1.1);
484 484 }
485 485
  486 +.tb-tooltip-multiline {
  487 + max-width: 400px;
  488 + height: auto !important;
  489 + padding-top: 6px;
  490 + padding-bottom: 6px;
  491 + line-height: 1.5;
  492 + white-space: normal !important;
  493 +}
  494 +
486 495 /***********************
487 496 * Flow
488 497 ***********************/
... ...