mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2026-03-13 10:22:08 +08:00
@@ -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);
|
||||
});
|
||||
}
|
||||
}
|
||||
}]);
|
||||
|
||||
12
js/ext/angular/src/directive/ionicToggle.js
vendored
12
js/ext/angular/src/directive/ionicToggle.js
vendored
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user