Skip to content

Commit

Permalink
Change button to checkbox techx#15
Browse files Browse the repository at this point in the history
Changed the buttons to be toggle checkboxes.
This is more intuitive than buttons, since 'allowMinors'
reflects state, and not an action.
  • Loading branch information
jeremy-melnyk committed Oct 28, 2017
1 parent fbd994d commit eedce19
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 9 deletions.
2 changes: 0 additions & 2 deletions app/client/views/admin/settings/adminSettingsCtrl.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@ angular.module('reg')
// Additional Options --------------------------------------

$scope.updateAllowMinors = function () {
$scope.settings.allowMinors = !$scope.settings.allowMinors;

SettingsService
.updateAllowMinors($scope.settings.allowMinors)
.success(function (data) {
Expand Down
21 changes: 14 additions & 7 deletions app/client/views/admin/settings/settings.html
Original file line number Diff line number Diff line change
Expand Up @@ -86,14 +86,21 @@
</div>

<div class="column">
<div class="ui buttons">
<button
class="ui toggle button"
ng-class="{true: 'active', false: ''}[settings.allowMinors]"
ng-click="updateAllowMinors()">
Minors {{ settings.allowMinors && 'allowed' || 'disallowed' }}
</button>
<div class="ui form">
<div class="grouped fields">
<div class="field">
<div class="ui toggle checkbox">
<input
type="checkbox"
name="allowMinors"
ng-class="{true: 'checked', false: ''}[settings.allowMinors]"
ng-model="settings.allowMinors"
ng-change="updateAllowMinors()">
<label>Allow minors</label>
</div>
</div>
</div>
</div>
</div>
</div>

Expand Down

0 comments on commit eedce19

Please sign in to comment.