Merge pull request #1574 from marshmalien/fix/capacity_adjustment_value

Add capacity adjuster slider label
This commit is contained in:
Marliana Lara
2018-03-21 11:35:03 -04:00
committed by GitHub
4 changed files with 22 additions and 13 deletions

View File

@@ -23,12 +23,13 @@
<span class="form-control Form-textInput Form-textInput--variableHeight LabelList-lookupTags" <span class="form-control Form-textInput Form-textInput--variableHeight LabelList-lookupTags"
ng-if="state._lookupTags"> ng-if="state._lookupTags">
<div class="LabelList-tagContainer" ng-repeat="tag in state._value track by $index"> <div class="LabelList-tagContainer" ng-repeat="tag in state._value track by $index">
<div class="LabelList-deleteContainer" ng-click="vm.removeTag(tag)"> <div class="LabelList-tag LabelList-tag--deletable">
<i class="fa fa-times LabelList-tagDelete"></i> <span ng-if="tag.hostname" class="LabelList-name">{{ tag.hostname }}</span>
</div> <span ng-if="!tag.hostname" class="LabelList-name">{{ tag }}</span>
<div class="LabelList-tag LabelList-tag--deletable"> </div>
<span ng-if="tag.hostname" class="LabelList-name">{{ tag.hostname }}</span> <div class="LabelList-deleteContainer" ng-click="vm.removeTag(tag)">
<span ng-if="!tag.hostname" class="LabelList-name">{{ tag }}</span> <i class="fa fa-times LabelList-tagDelete"></i>
</div>
</div> </div>
</span> </span>
</div> </div>

View File

@@ -1,7 +1,18 @@
.CapacityAdjuster { .CapacityAdjuster {
margin-right: @at-space-4x;
position: relative;
&-valueLabel {
bottom: @at-space-5x;
color: @at-color-body-text;
font-size: @at-font-size;
position: absolute;
text-align: center;
width: 100%;
}
.at-InputSlider { .at-InputSlider {
align-items: center; align-items: center;
margin-right: @at-space-4x;
} }
.at-InputSlider p { .at-InputSlider p {

View File

@@ -1,4 +1,5 @@
<div class="CapacityAdjuster"> <div class="CapacityAdjuster">
<span class="CapacityAdjuster-valueLabel">{{ state.capacity_adjustment }}</span>
<div class="at-InputSlider"> <div class="at-InputSlider">
<p>{{min_capacity.label}} {{min_capacity.value}}</p> <p>{{min_capacity.label}} {{min_capacity.value}}</p>
<input string-to-number <input string-to-number

View File

@@ -75,12 +75,8 @@ angular.module('AWDirectives', ['RestServices', 'Utilities'])
require: 'ngModel', require: 'ngModel',
restrict: 'A', restrict: 'A',
link: function(scope, element, attrs, ngModel) { link: function(scope, element, attrs, ngModel) {
ngModel.$parsers.push(function(value) { ngModel.$parsers.push(value => value.toFixed(2));
return '' + value; ngModel.$formatters.push(value => parseFloat(value));
});
ngModel.$formatters.push(function(value) {
return parseFloat(value);
});
} }
}; };
}) })