mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2026-03-13 10:22:08 +08:00
Fixed #366 - no Android scroll bouncing by default
This commit is contained in:
8
js/ext/angular/src/directive/ionicContent.js
vendored
8
js/ext/angular/src/directive/ionicContent.js
vendored
@@ -18,7 +18,7 @@ angular.module('ionic.ui.content', ['ionic.ui.service'])
|
||||
|
||||
// The content directive is a core scrollable content area
|
||||
// that is part of many View hierarchies
|
||||
.directive('content', ['$parse', '$timeout', 'ScrollDelegate', function($parse, $timeout, ScrollDelegate) {
|
||||
.directive('content', ['$parse', '$timeout', 'Platform', 'ScrollDelegate', function($parse, $timeout, Platform, ScrollDelegate) {
|
||||
return {
|
||||
restrict: 'E',
|
||||
replace: true,
|
||||
@@ -32,6 +32,7 @@ angular.module('ionic.ui.content', ['ionic.ui.service'])
|
||||
refreshComplete: '=',
|
||||
onInfiniteScroll: '=',
|
||||
infiniteScrollDistance: '@',
|
||||
hasBouncing: '@',
|
||||
scroll: '@',
|
||||
hasScrollX: '@',
|
||||
hasScrollY: '@',
|
||||
@@ -87,8 +88,13 @@ angular.module('ionic.ui.content', ['ionic.ui.service'])
|
||||
|
||||
// Otherwise, supercharge this baby!
|
||||
$timeout(function() {
|
||||
var hasBouncing = $scope.$eval($scope.hasBouncing);
|
||||
var enableBouncing = !Platform.is('Android') && hasBouncing !== false;
|
||||
// No bouncing by default for Android users, lest they take up pitchforks
|
||||
// to our bouncing goodness
|
||||
sv = new ionic.views.Scroll({
|
||||
el: $element[0],
|
||||
bouncing: enableBouncing,
|
||||
scrollbarX: $scope.$eval($scope.scrollbarX) !== false,
|
||||
scrollbarY: $scope.$eval($scope.scrollbarY) !== false,
|
||||
scrollingX: $scope.$eval($scope.hasScrollX) === true,
|
||||
|
||||
4
js/ext/angular/src/service/ionicPlatform.js
vendored
4
js/ext/angular/src/service/ionicPlatform.js
vendored
@@ -66,6 +66,10 @@ angular.module('ionic.service.platform', [])
|
||||
});
|
||||
},
|
||||
|
||||
is: function(type) {
|
||||
return ionic.Platform.is(type);
|
||||
},
|
||||
|
||||
/**
|
||||
* Trigger a callback once the device is ready, or immediately if the device is already
|
||||
* ready.
|
||||
|
||||
Reference in New Issue
Block a user