Skip to content
This repository has been archived by the owner on May 23, 2019. It is now read-only.

Commit

Permalink
knob: fix range settings and default text color (#249)
Browse files Browse the repository at this point in the history
Fixes #240.

Signed-off-by: Yannick Schaus <[email protected]>
  • Loading branch information
ghys authored Dec 16, 2017
1 parent fac0a96 commit 04a675e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
9 changes: 6 additions & 3 deletions web/app/widgets/knob/knob.settings.tpl.html
Original file line number Diff line number Diff line change
Expand Up @@ -367,10 +367,13 @@ <h4 class="col-lg-12 col-md-12">Tron skin settings</h4>
</div>
</div>
<button type="button" class="btn" ng-click="addRange()"><i class="glyphicon glyphicon-plus"></i></button>
<br /><br />
<uib-accordion>
<div uib-accordion-group is-open="accordions[$index]" class="panel default" ng-repeat="range in form.ranges">
<uib-accordion-heading>
<span class="badge" style="width: 50px; margin-right: 10px; background-color :{{range.barColor}};">&nbsp</span>{{range.min + ' - ' + range.max || 'N/A'}}
<span ng-style="{ 'background-color': range.barColor }" style="border: 1px solid black">&nbsp;&nbsp;&nbsp;</span>
&nbsp;
{{range.min + ' - ' + range.max || 'N/A'}}
</uib-accordion-heading>
<div class="col-lg-12 col-md-12">
<button type="button" class="btn pull-right" ng-click="removeRange($index)"><i class="glyphicon glyphicon-trash"></i></button>
Expand All @@ -380,15 +383,15 @@ <h4 class="col-lg-12 col-md-12">Tron skin settings</h4>
<div class="form-group">
<label class="control-label col-xs-2">from</label>
<div class="col-xs-6">
<input name="name" type="number" ng-model="range.min" class="form-control" />
<input name="name" type="number" step="any" ng-model="range.min" class="form-control" />
</div>
</div>
</div>
<div class="col-xs-6">
<div class="form-group">
<label class="control-label col-xs-2">to</label>
<div class="col-xs-6">
<input name="name" type="number" ng-model="range.max" class="form-control" />
<input name="name" type="number" step="any" ng-model="range.max" class="form-control" />
</div>
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion web/app/widgets/knob/knob.widget.js
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@
if ( vm.widget.rangesEnabled) {
vm.widget.ranges.forEach(function(rangeItem) {
if (rangeItem.min != 0 || rangeItem.max != 0) {
var textColor = vm.widget.textColor;
var textColor = themeValueFilter(vm.widget.textColor, 'primary-color');
if (vm.widget.rangesTextColorMatching == true) {
textColor = rangeItem.barColor;
}
Expand Down

0 comments on commit 04a675e

Please sign in to comment.