This commit is contained in:
Max Lynch
2013-11-25 14:26:34 -06:00
parent ee034816fc
commit 4646f5d459
66 changed files with 1596 additions and 34342 deletions

View File

@@ -353,14 +353,10 @@ angular.module('ionic.ui.navRouter', ['ionic.service.gesture'])
if($rootScope.stackCursorPosition > 0) {
$window.history.back();
}
e.alreadyHandled = true;
return false;
};
var tapGesture = Gesture.on('tap', goBack, $element);
$element.bind('click', goBack);
$scope.$on('$destroy', function() {
Gesture.off(tapGesture, 'tap', goBack);
$element.unbind('click', goBack);
});
}
}
}]);

View File

@@ -10,8 +10,8 @@ angular.module('ionic.ui.toggle', [])
restrict: 'E',
replace: true,
require: '?ngModel',
scope: true,
template: '<div class="toggle"><input type="checkbox"><div class="track"><div class="handle"></div></div></div>',
scope: {},
template: '<div ng-click="toggleIt($event)" class="toggle"><input type="checkbox"><div class="track"><div class="handle"></div></div></div>',
link: function($scope, $element, $attr, ngModel) {
var checkbox, handle;
@@ -29,12 +29,10 @@ angular.module('ionic.ui.toggle', [])
handle: handle[0]
});
$element.bind('click', function(e) {
$scope.toggleIt = function(e) {
$scope.toggle.tap(e);
$scope.$apply(function() {
ngModel.$setViewValue(checkbox[0].checked);
});
});
ngModel.$setViewValue(checkbox[0].checked);
};
ngModel.$render = function() {
$scope.toggle.val(ngModel.$viewValue);