Skip to content

Commit

Permalink
feat(toggle): Disable toggle w/ ng-disabled, closes #541
Browse files Browse the repository at this point in the history
  • Loading branch information
Adam Bradley committed Feb 6, 2014
1 parent d15905f commit 2eab747
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
1 change: 0 additions & 1 deletion js/ext/angular/src/directive/ionicToggle.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ angular.module('ionic.ui.toggle', [])
if(attr.ngChecked) input.attr('ng-checked', 'ngChecked');
if(attr.ngTrueValue) input.attr('ng-true-value', attr.ngTrueValue);
if(attr.ngFalseValue) input.attr('ng-false-value', attr.ngFalseValue);
if(attr.ngDisabled) input.attr('ng-false-value', attr.ngFalseValue);

// return function link($scope, $element, $attr, ngModel) {
// var el, checkbox, track, handle;
Expand Down
2 changes: 1 addition & 1 deletion js/ext/angular/test/toggle.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<html ng-app="toggleTest">
<head>
<meta charset="utf-8">
<title>Radio</title>
<title>Toggle</title>

<!-- Sets initial viewport load and disables zooming -->
<meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no">
Expand Down
4 changes: 4 additions & 0 deletions scss/_toggle.scss
Original file line number Diff line number Diff line change
Expand Up @@ -84,3 +84,7 @@
right: $item-padding;
z-index: $z-index-item-toggle;
}

.toggle input:disabled + .track {
opacity: .6;
}

0 comments on commit 2eab747

Please sign in to comment.