-
-
Save mlynch/59b5465ee9142ef09d7c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<key>NSAppTransportSecurity</key> | |
<dict> | |
<key>NSAllowsArbitraryLoads</key><true/> | |
</dict> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.directive('ionRadioFix', function() { | |
return { | |
restrict: 'E', | |
replace: true, | |
require: '?ngModel', | |
transclude: true, | |
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(element, attr) { | |
if (attr.icon) { | |
var iconElm = element.find('i'); | |
iconElm.removeClass('ion-checkmark').addClass(attr.icon); | |
} | |
var input = element.find('input'); | |
angular.forEach({ | |
'name': attr.name, | |
'value': attr.value, | |
'disabled': attr.disabled, | |
'ng-value': attr.ngValue, | |
'ng-model': attr.ngModel, | |
'ng-disabled': attr.ngDisabled, | |
'ng-change': attr.ngChange, | |
'ng-required': attr.ngRequired, | |
'required': attr.required | |
}, function(value, name) { | |
if (angular.isDefined(value)) { | |
input.attr(name, value); | |
} | |
}); | |
return function(scope, element, attr) { | |
scope.getValue = function() { | |
return scope.ngValue || attr.value; | |
}; | |
}; | |
} | |
}; | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.item-radio input:checked + .radio-content .item-content { | |
/* style the item content when its checked */ | |
background: #f7f7f7; | |
} | |
.item-radio input:checked + .radio-content .radio-icon { | |
/* show the checkmark icon when its checked */ | |
visibility: visible; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment