feat($ionicScrollDelegate): expose zoomBy and zoomTo methods

Closes #1977
This commit is contained in:
Andrew
2014-08-20 12:19:42 -06:00
parent 5d06c4aef8
commit 029f8f3353
2 changed files with 30 additions and 0 deletions

View File

@@ -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);