diff --git a/ui/src/app/components/timewindow-button.tpl.html b/ui/src/app/components/timewindow-button.tpl.html index 6edf9c76a0..5549fd35e6 100644 --- a/ui/src/app/components/timewindow-button.tpl.html +++ b/ui/src/app/components/timewindow-button.tpl.html @@ -15,7 +15,7 @@ limitations under the License. --> - + {{model.displayValue}} \ No newline at end of file diff --git a/ui/src/app/components/timewindow.directive.js b/ui/src/app/components/timewindow.directive.js index 0d06de8679..991a3838ff 100644 --- a/ui/src/app/components/timewindow.directive.js +++ b/ui/src/app/components/timewindow.directive.js @@ -97,7 +97,7 @@ function Timewindow($compile, $templateCache, $filter, $mdPanel, $document, $mdM element.html(template); scope.openEditMode = function (event) { - if (scope.disabled) { + if (scope.timewindowDisabled) { return; } var position; @@ -212,6 +212,10 @@ function Timewindow($compile, $templateCache, $filter, $mdPanel, $document, $mdM } } + scope.isTimewindowDisabled = function () { + return scope.disabled || (!scope.isEdit && scope.model.hideInterval && scope.model.hideAggregation && scope.model.hideAggInterval); + } + ngModelCtrl.$render = function () { scope.model = timeService.defaultTimewindow(); if (ngModelCtrl.$viewValue) { @@ -243,6 +247,7 @@ function Timewindow($compile, $templateCache, $filter, $mdPanel, $document, $mdM model.hideAggregation = value.hideAggregation; model.hideAggInterval = value.hideAggInterval; } + scope.timewindowDisabled = scope.isTimewindowDisabled(); scope.updateDisplayValue(); }; diff --git a/ui/src/app/components/timewindow.tpl.html b/ui/src/app/components/timewindow.tpl.html index 0e0475b9cd..2889addd5a 100644 --- a/ui/src/app/components/timewindow.tpl.html +++ b/ui/src/app/components/timewindow.tpl.html @@ -16,7 +16,7 @@ -->
- + {{ 'timewindow.edit' | translate }} @@ -28,7 +28,7 @@ {{model.displayValue}} - + {{ 'timewindow.edit' | translate }}