diff --git a/dist/js/ionic-angular.js b/dist/js/ionic-angular.js index 088ed1580e..1dee297b0f 100644 --- a/dist/js/ionic-angular.js +++ b/dist/js/ionic-angular.js @@ -587,32 +587,29 @@ angular.module('ionic.ui.checkbox', []) require: '?ngModel', scope: {}, transclude: true, - template: '', - + template: '
  • \ + \ +
    \ +
    \ +
  • ', link: function($scope, $element, $attr, ngModel) { var checkbox; if(!ngModel) { return; } - checkbox = $element.children().eq(0); + checkbox = angular.element($element[0].querySelector('input[type="checkbox"]')); if(!checkbox.length) { return; } - $scope.tapHandler = function(e) { - if(e.type != 'click') { - checkbox[0].checked = !checkbox[0].checked; - } + checkbox.bind('change', function(e) { ngModel.$setViewValue(checkbox[0].checked); - e.alreadyHandled = true; - }; - - var clickHandler = function(e) { - checkbox[0].checked = !checkbox[0].checked; $scope.$apply(function() { - ngModel.$setViewValue(checkbox[0].checked); + e.alreadyHandled = true; }); - }; + }); if(ngModel) { ngModel.$render = function() { @@ -1083,7 +1080,7 @@ angular.module('ionic.ui.navRouter', ['ionic.service.gesture']) }; }], - link: function($scope, $element, $attr) { + link: function($scope, $element, $attr, ctrl) { if(!$element.length) return; $scope.animation = $attr.animation; @@ -1142,6 +1139,10 @@ angular.module('ionic.ui.navRouter', ['ionic.service.gesture']) } }); + $scope.$on('navRouter.goBack', function(e) { + ctrl.goBack(); + }); + // Keep track of location changes and update a stack pointer that tracks whether we are // going forwards or back @@ -1413,7 +1414,6 @@ angular.module('ionic.ui.navRouter', ['ionic.service.gesture']) .directive('navBack', ['$window', '$rootScope', 'Gesture', function($window, $rootScope, Gesture) { return { restrict: 'AC', - require: '^?navRouter', link: function($scope, $element, $attr, navCtrl) { var goBack = function(e) { // Only trigger back if the stack is greater than zero @@ -1421,7 +1421,7 @@ angular.module('ionic.ui.navRouter', ['ionic.service.gesture']) $window.history.back(); // Fallback for bad history supporting devices - navCtrl.goBack(); + $scope.$emit('navRouter.goBack'); } e.alreadyHandled = true; return false; @@ -1449,8 +1449,8 @@ angular.module('ionic.ui.radio', []) value: '@' }, transclude: true, - template: '