Commit 6c33dc9265d448078ecd1a9148caebf3d88f9bac

Authored by Igor Kulikov
1 parent 795a99bb

UI: Minor fixes

... ... @@ -106,7 +106,9 @@ function ExpandFullscreen($compile, $document) {
106 106 buttonSize = attrs.expandButtonSize;
107 107 }
108 108
109   - var html = '<md-tooltip md-direction="{{expanded ? \'bottom\' : \'top\'}}">' +
  109 + var tooltipDirection = angular.isDefined(attrs.expandTooltipDirection) ? attrs.expandTooltipDirection : 'top';
  110 +
  111 + var html = '<md-tooltip md-direction="{{expanded ? \'bottom\' : \'' + tooltipDirection + '\'}}">' +
110 112 '{{(expanded ? \'fullscreen.exit\' : \'fullscreen.expand\') | translate}}' +
111 113 '</md-tooltip>' +
112 114 '<ng-md-icon ' + (buttonSize ? 'size="'+ buttonSize +'" ' : '') + 'icon="{{expanded ? \'fullscreen_exit\' : \'fullscreen\'}}" ' +
... ... @@ -115,13 +117,16 @@ function ExpandFullscreen($compile, $document) {
115 117
116 118 if (expandButton) {
117 119 expandButton = angular.element(expandButton);
118   - expandButton.attr('md-ink-ripple', 'false');
119   - expandButton.append(html);
120   -
121   - $compile(expandButton.contents())(scope);
  120 + if (scope.hideExpandButton()) {
  121 + expandButton.remove();
  122 + } else {
  123 + expandButton.attr('md-ink-ripple', 'false');
  124 + expandButton.append(html);
122 125
123   - expandButton.on("click", scope.toggleExpand);
  126 + $compile(expandButton.contents())(scope);
124 127
  128 + expandButton.on("click", scope.toggleExpand);
  129 + }
125 130 } else if (!scope.hideExpandButton()) {
126 131 var button = angular.element('<md-button class="tb-fullscreen-button-style tb-fullscreen-button-pos md-icon-button" ' +
127 132 'md-ink-ripple="false" ng-click="toggleExpand($event)">' +
... ...
... ... @@ -79,7 +79,8 @@ function Timewindow($compile, $templateCache, $filter, $mdPanel, $document, $mdM
79 79 if (scope.asButton) {
80 80 template = $templateCache.get(timewindowButtonTemplate);
81 81 } else {
82   - scope.direction = scope.direction || 'left';
  82 + scope.direction = angular.isDefined(attrs.direction) ? attrs.direction : 'left';
  83 + scope.tooltipDirection = angular.isDefined(attrs.tooltipDirection) ? attrs.tooltipDirection : 'top';
83 84 template = $templateCache.get(timewindowTemplate);
84 85 }
85 86 element.html(template);
... ... @@ -235,7 +236,6 @@ function Timewindow($compile, $templateCache, $filter, $mdPanel, $document, $mdM
235 236 require: "^ngModel",
236 237 scope: {
237 238 asButton: '=asButton',
238   - direction: '=?',
239 239 disabled:'=ngDisabled'
240 240 },
241 241 link: linker
... ...
... ... @@ -17,19 +17,19 @@
17 17 -->
18 18 <section layout='row' layout-align="start center" ng-style="{minHeight: '32px', padding: '0 6px'}">
19 19 <md-button ng-if="direction === 'left'" ng-disabled="disabled" class="md-icon-button tb-md-32" aria-label="{{ 'timewindow.edit' | translate }}" ng-click="openEditMode($event)">
20   - <md-tooltip md-direction="top">
  20 + <md-tooltip md-direction="{{tooltipDirection}}">
21 21 {{ 'timewindow.edit' | translate }}
22 22 </md-tooltip>
23 23 <ng-md-icon aria-label="{{ 'timewindow.date-range' | translate }}" icon="query_builder"></ng-md-icon>
24 24 </md-button>
25 25 <span ng-click="openEditMode($event)">
26   - <md-tooltip md-direction="top">
  26 + <md-tooltip md-direction="{{tooltipDirection}}">
27 27 {{ 'timewindow.edit' | translate }}
28 28 </md-tooltip>
29 29 {{model.displayValue}}
30 30 </span>
31 31 <md-button ng-if="direction === 'right'" ng-disabled="disabled" class="md-icon-button tb-md-32" aria-label="{{ 'timewindow.edit' | translate }}" ng-click="openEditMode($event)">
32   - <md-tooltip md-direction="top">
  32 + <md-tooltip md-direction="{{tooltipDirection}}">
33 33 {{ 'timewindow.edit' | translate }}
34 34 </md-tooltip>
35 35 <ng-md-icon aria-label="{{ 'timewindow.date-range' | translate }}" icon="query_builder"></ng-md-icon>
... ...
... ... @@ -16,8 +16,8 @@
16 16
17 17 -->
18 18 <md-content flex tb-expand-fullscreen="vm.widgetEditMode || vm.iframeMode" expand-button-id="dashboard-expand-button"
19   - hide-expand-button="vm.widgetEditMode || vm.iframeMode"
20   - ng-style="{'background-color': vm.dashboard.configuration.gridSettings.backgroundColor,
  19 + hide-expand-button="vm.widgetEditMode || vm.iframeMode" expand-tooltip-direction="bottom"
  20 + ng-style="{'background-color': vm.dashboard.configuration.gridSettings.backgroundColor,
21 21 'background-image': 'url('+vm.dashboard.configuration.gridSettings.backgroundImageUrl+')',
22 22 'background-repeat': 'no-repeat',
23 23 'background-attachment': 'scroll',
... ... @@ -29,7 +29,7 @@
29 29 md-direction="left">
30 30 <md-fab-trigger class="align-with-text">
31 31 <md-button aria-label="menu" class="md-fab md-primary" ng-click="vm.openToolbar()">
32   - <md-tooltip ng-show="!vm.toolbarOpened" md-direction="top">
  32 + <md-tooltip ng-show="!vm.toolbarOpened" md-direction="bottom">
33 33 {{ 'dashboard.open-toolbar' | translate }}
34 34 </md-tooltip>
35 35 <md-icon aria-label="dashboard-toolbar" class="material-icons">more_horiz</md-icon>
... ... @@ -38,7 +38,7 @@
38 38 <md-toolbar>
39 39 <md-fab-actions class="md-toolbar-tools">
40 40 <md-button ng-show="!vm.isEdit" aria-label="close-toolbar" class="md-icon-button close-action" ng-click="vm.closeToolbar()">
41   - <md-tooltip md-direction="top">
  41 + <md-tooltip md-direction="bottom">
42 42 {{ 'dashboard.close-toolbar' | translate }}
43 43 </md-tooltip>
44 44 <md-icon aria-label="close-toolbar" class="material-icons">arrow_forward</md-icon>
... ... @@ -47,18 +47,18 @@
47 47 aria-label="{{ 'fullscreen.fullscreen' | translate }}"
48 48 class="md-icon-button">
49 49 </md-button>
50   - <tb-timewindow direction="left" aggregation ng-model="vm.dashboardConfiguration.timewindow">
  50 + <tb-timewindow direction="left" tooltip-direction="bottom" aggregation ng-model="vm.dashboardConfiguration.timewindow">
51 51 </tb-timewindow>
52 52 <md-button ng-show="vm.isEdit" aria-label="{{ 'device.aliases' | translate }}" class="md-icon-button"
53 53 ng-click="vm.openDeviceAliases($event)">
54   - <md-tooltip md-direction="top">
  54 + <md-tooltip md-direction="bottom">
55 55 {{ 'device.aliases' | translate }}
56 56 </md-tooltip>
57 57 <md-icon aria-label="{{ 'device.aliases' | translate }}" class="material-icons">devices_other</md-icon>
58 58 </md-button>
59 59 <md-button ng-show="vm.isEdit" aria-label="{{ 'dashboard.settings' | translate }}" class="md-icon-button"
60 60 ng-click="vm.openDashboardSettings($event)">
61   - <md-tooltip md-direction="top">
  61 + <md-tooltip md-direction="bottom">
62 62 {{ 'dashboard.settings' | translate }}
63 63 </md-tooltip>
64 64 <md-icon aria-label="{{ 'dashboard.settings' | translate }}" class="material-icons">settings</md-icon>
... ...