diff --git a/js/ext/angular/src/controller/ionicScrollController.js b/js/ext/angular/src/controller/ionicScrollController.js index 60e6200faf..7f3d0d5db2 100644 --- a/js/ext/angular/src/controller/ionicScrollController.js +++ b/js/ext/angular/src/controller/ionicScrollController.js @@ -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 diff --git a/js/ext/angular/test/directive/ionicScroll.unit.js b/js/ext/angular/test/directive/ionicScroll.unit.js index cff691b81d..49449e245b 100644 --- a/js/ext/angular/test/directive/ionicScroll.unit.js +++ b/js/ext/angular/test/directive/ionicScroll.unit.js @@ -9,6 +9,9 @@ describe('Ionic Scroll Directive', function() { timeout = $timeout; window = $window; ionic.Platform.setPlatform('Android'); + spyOn(ionic.Platform, 'ready').andCallFake(function(cb) { + cb(); + }); })); it('Has $ionicScroll controller', function() { diff --git a/js/views/scrollView.js b/js/views/scrollView.js index f6f2cbc324..8e22eb678d 100644 --- a/js/views/scrollView.js +++ b/js/views/scrollView.js @@ -292,8 +292,6 @@ ionic.views.Scroll = ionic.views.View.inherit({ this.__container = options.el; this.__content = options.el.firstElementChild; - var self = this; - //Remove any scrollTop attached to these elements; they are virtual scroll now //This also stops on-load-scroll-to-window.location.hash that the browser does setTimeout(function() {