diff --git a/js/angular/controller/scrollController.js b/js/angular/controller/scrollController.js index 5bf28e0c332..b5b742261ec 100644 --- a/js/angular/controller/scrollController.js +++ b/js/angular/controller/scrollController.js @@ -140,6 +140,18 @@ function($scope, scrollViewOptions, $timeout, $window, $$scrollValueCache, $loca }); }; + this.zoomTo = function(zoom, shouldAnimate, originLeft, originTop) { + this.resize().then(function() { + scrollView.zoomTo(zoom, !!shouldAnimate, originLeft, originTop); + }); + }; + + this.zoomBy = function(zoom, shouldAnimate, originLeft, originTop) { + this.resize().then(function() { + scrollView.zoomBy(zoom, !!shouldAnimate, originLeft, originTop); + }); + }; + this.scrollBy = function(left, top, shouldAnimate) { this.resize().then(function() { scrollView.scrollBy(left, top, !!shouldAnimate); diff --git a/js/angular/service/scrollDelegate.js b/js/angular/service/scrollDelegate.js index 955664da86b..4ebb2ac636b 100644 --- a/js/angular/service/scrollDelegate.js +++ b/js/angular/service/scrollDelegate.js @@ -93,6 +93,24 @@ IonicModule * @param {boolean=} shouldAnimate Whether the scroll should animate. */ 'scrollBy', + /** + * @ngdoc method + * @name $ionicScrollDelegate#zoomTo + * @param {number} level Level to zoom to. + * @param {boolean=} animate Whether to animate the zoom. + * @param {number=} originLeft Zoom in at given left coordinate. + * @param {number=} originTop Zoom in at given top coordinate. + */ + 'zoomTo', + /** + * @ngdoc method + * @name $ionicScrollDelegate#zoomBy + * @param {number} factor The factor to zoom by. + * @param {boolean=} animate Whether to animate the zoom. + * @param {number=} originLeft Zoom in at given left coordinate. + * @param {number=} originTop Zoom in at given top coordinate. + */ + 'zoomBy', /** * @ngdoc method * @name $ionicScrollDelegate#getScrollPosition