mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2026-03-13 10:22:08 +08:00
feat($ionicScrollDelegate): rememberScrollPosition, scrollToRememberedPosition
/**
* @ngdoc method
* @name $ionicScrollDelegate#rememberScrollPosition
* @description
*
* When this scroll area is destroyed, its last scroll position will be
* saved using the given id.
*
* @param {string} id The identifier for this saved scroll position.
*/
/**
* @ngdoc method
* @name $ionicScrollDelegate#scrollToRememberedPosition
* @description
*
* If a scroll position was remembered using the given id, loads the
* remembered scroll position and scrolls there.
*
* @param {string} id The identifier for this saved scroll position.
* @param {boolean=} shouldAnimate Whether to animate the scroll.
*/
This commit is contained in:
@@ -141,7 +141,7 @@ describe('Ionic View Service', function() {
|
||||
registerData = viewService.register({});
|
||||
currentView = viewService.getCurrentView();
|
||||
//Set test value for remembered scroll
|
||||
currentView.scrollValues = 'foo';
|
||||
currentView.rememberedScrollValues = 'foo';
|
||||
backView = viewService.getBackView();
|
||||
forwardView = viewService.getForwardView();
|
||||
expect(backView.stateName).toEqual('about');
|
||||
@@ -159,7 +159,7 @@ describe('Ionic View Service', function() {
|
||||
currentView = viewService.getCurrentView();
|
||||
backView = viewService.getBackView();
|
||||
forwardView = viewService.getForwardView();
|
||||
expect(forwardView.scrollValues).toEqual({});
|
||||
expect(forwardView.rememberedScrollValues).toEqual({});
|
||||
expect(currentView.stateName).toEqual('about');
|
||||
expect(currentView.backViewId).toEqual(backView.viewId);
|
||||
expect(currentView.forwardViewId).toEqual(forwardView.viewId);
|
||||
|
||||
Reference in New Issue
Block a user