Skip to content

Commit

Permalink
Replace the button with the switch
Browse files Browse the repository at this point in the history
  • Loading branch information
LeptitGeek authored Nov 12, 2017
1 parent 7a707a3 commit 077dccf
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions views/device/index.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -85,10 +85,14 @@
</div>
</form>
<!-- If the deviceType is not a sensor and is a binary, display on/off button -->
<button ng-show="!type.sensor && type.type == 'binary'" ng-click="vm.changeValue(type, !type.lastValue);"
class="btn {{ type.lastValue && 'btn-danger' || 'btn-success' }} btn-sm">
{{type.lastValue && '<%= __('devices-types-off') %>' || '<%= __('devices-types-on') %>' }}
</button>
<!--<button ng-show="!type.sensor && type.type == 'binary'" ng-click="vm.changeValue(type, !type.lastValue);"
class="btn {{ type.lastValue && 'btn-danger' || 'btn-success' }} btn-sm">
{{type.lastValue && '<%= __('devices-types-off') %>' || '<%= __('devices-types-on') %>' }}
</button>-->
<div class="onoffswitch" ng-click="vm.changeValue(type, !type.lastValue);">
<input type="checkbox" ng-show="!type.sensor && type.type == 'binary'" ng-model="type.lastValue" ng-true-value="1" ng-false-value="0" class="onoffswitch-checkbox" />
<label class="onoffswitch-label" for="myonoffswitch" ng-show="!type.sensor && type.type == 'binary'"></label>
</div>
</td>
</tr>
</tbody>
Expand Down Expand Up @@ -358,4 +362,4 @@





0 comments on commit 077dccf

Please sign in to comment.