summaryrefslogtreecommitdiff
path: root/www/external/js/ionRadio.min.js
blob: d652fddaa601738c9f8ba6adbc242e535d44d024 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
/**
 * ionRadioFix - fixes a bug in iOS 9 UIWebView that breaks the tilde selector in CSS. To
 * use this fix, include it after your Ionic bundle JS.
 * 
 * Note: due to Angular directive override limitations, you'll need to change any reference
 * to <ion-radio> to <ion-radio-fix> to apply this patched radio button.
 * 
 * Also, make sure to add the new CSS from the second part of this gist.
 */
angular.module("ionic").directive("ionRadioFix",function(){return{restrict:"E",replace:!0,require:"?ngModel",transclude:!0,template:'<label class="item item-radio"><input type="radio" name="radio-group"><div class="radio-content"><div class="item-content disable-pointer-events" ng-transclude></div><i class="radio-icon disable-pointer-events icon ion-checkmark"></i></div></label>',compile:function(e,n){if(n.icon){var i=e.find("i")
i.removeClass("ion-checkmark").addClass(n.icon)}var a=e.find("input")
return angular.forEach({name:n.name,value:n.value,disabled:n.disabled,"ng-value":n.ngValue,"ng-model":n.ngModel,"ng-disabled":n.ngDisabled,"ng-change":n.ngChange,"ng-required":n.ngRequired,required:n.required},function(e,n){angular.isDefined(e)&&a.attr(n,e)}),function(e,n,i){e.getValue=function(){return e.ngValue||i.value}}}}})