diff --git a/js/angular/controller/scrollController.js b/js/angular/controller/scrollController.js index e35649215f7..e3635029ce6 100644 --- a/js/angular/controller/scrollController.js +++ b/js/angular/controller/scrollController.js @@ -114,7 +114,7 @@ function($scope, scrollViewOptions, $timeout, $window, $$scrollValueCache, $loca }); $timeout(function() { - scrollView.run(); + scrollView && scrollView.run && scrollView.run(); }); this._rememberScrollId = null; @@ -129,7 +129,7 @@ function($scope, scrollViewOptions, $timeout, $window, $$scrollValueCache, $loca this.resize = function() { return $timeout(resize).then(function() { - $element.triggerHandler('scroll.resize'); + $element && $element.triggerHandler('scroll.resize'); }); }; @@ -204,7 +204,7 @@ function($scope, scrollViewOptions, $timeout, $window, $$scrollValueCache, $loca var values = $$scrollValueCache[this._rememberScrollId]; if (values) { this.resize().then(function() { - scrollView.scrollTo(+values.left, +values.top, shouldAnimate); + scrollView && scrollView.scrollTo && scrollView.scrollTo(+values.left, +values.top, shouldAnimate); }); } }; diff --git a/js/views/scrollView.js b/js/views/scrollView.js index 8e07ffe85b2..b74d971676f 100644 --- a/js/views/scrollView.js +++ b/js/views/scrollView.js @@ -1114,6 +1114,8 @@ ionic.views.Scroll = ionic.views.View.inherit({ }, resize: function() { + if(!this.__container || !this.options) return; + // Update Scroller dimensions for changed content // Add padding to bottom of content this.setDimensions(