Commit 6c33dc9265d448078ecd1a9148caebf3d88f9bac

Authored by Igor Kulikov
1 parent 795a99bb

UI: Minor fixes

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