mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2026-03-13 10:22:08 +08:00
fix(scrollView): fix error from checking device before ready
This commit is contained in:
@@ -5,15 +5,17 @@ angular.module('ionic.ui.scroll')
|
||||
|
||||
.controller('$ionicScroll', ['$scope', 'scrollViewOptions', '$timeout', '$ionicScrollDelegate', '$window', function($scope, scrollViewOptions, $timeout, $ionicScrollDelegate, $window) {
|
||||
|
||||
scrollViewOptions.bouncing = angular.isDefined(scrollViewOptions.bouncing) ?
|
||||
scrollViewOptions.bouncing :
|
||||
!ionic.Platform.isAndroid();
|
||||
|
||||
var self = this;
|
||||
|
||||
var element = this.element = scrollViewOptions.el;
|
||||
var scrollView = this.scrollView = new ionic.views.Scroll(scrollViewOptions);
|
||||
|
||||
if (!angular.isDefined(scrollViewOptions.bouncing)) {
|
||||
ionic.Platform.ready(function() {
|
||||
scrollView.options.bouncing = !ionic.Platform.isAndroid();
|
||||
});
|
||||
}
|
||||
|
||||
var $element = this.$element = angular.element(element);
|
||||
|
||||
//Attach self to element as a controller so other directives can require this controller
|
||||
|
||||
Reference in New Issue
Block a user