From 2eab747d47dbe3b299d7f3ed69fd790cad936e4e Mon Sep 17 00:00:00 2001 From: Adam Bradley Date: Thu, 6 Feb 2014 15:57:25 -0600 Subject: [PATCH] feat(toggle): Disable toggle w/ ng-disabled, closes #541 --- js/ext/angular/src/directive/ionicToggle.js | 1 - js/ext/angular/test/toggle.html | 2 +- scss/_toggle.scss | 4 ++++ 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/js/ext/angular/src/directive/ionicToggle.js b/js/ext/angular/src/directive/ionicToggle.js index 1d2368a5f3e..93f2f130cd3 100644 --- a/js/ext/angular/src/directive/ionicToggle.js +++ b/js/ext/angular/src/directive/ionicToggle.js @@ -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; diff --git a/js/ext/angular/test/toggle.html b/js/ext/angular/test/toggle.html index b57b1524a98..55a632551ac 100644 --- a/js/ext/angular/test/toggle.html +++ b/js/ext/angular/test/toggle.html @@ -1,7 +1,7 @@ - Radio + Toggle diff --git a/scss/_toggle.scss b/scss/_toggle.scss index 2cb667cd78d..6076f39de95 100644 --- a/scss/_toggle.scss +++ b/scss/_toggle.scss @@ -84,3 +84,7 @@ right: $item-padding; z-index: $z-index-item-toggle; } + +.toggle input:disabled + .track { + opacity: .6; +}