mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2026-03-13 10:22:08 +08:00
feat(menuClose): do not show next back button
When navigating to a view from a button/link with the `menuClose` attribute directive, the back button should not show for the next view.
This commit is contained in:
@@ -79,6 +79,47 @@ describe('Ionic View Switcher', function() {
|
||||
expect(d.direction).toEqual('forward');
|
||||
}));
|
||||
|
||||
it('should set showBack when the view data sets it', inject(function($ionicViewSwitcher) {
|
||||
var d = $ionicViewSwitcher.getTransitionData(null, null, null, null, true);
|
||||
expect(d.showBack).toEqual(true);
|
||||
|
||||
d = $ionicViewSwitcher.getTransitionData(null, null, null, null, false);
|
||||
expect(d.showBack).toEqual(false);
|
||||
|
||||
d = $ionicViewSwitcher.getTransitionData(null, null, null, null, null);
|
||||
expect(d.showBack).toEqual(false);
|
||||
}));
|
||||
|
||||
it('should override showBack from view data w/ $ionicViewSwitcher.nextShowBack() setting', inject(function($ionicViewSwitcher) {
|
||||
$ionicViewSwitcher.nextShowBack(true);
|
||||
var d = $ionicViewSwitcher.getTransitionData(null, null, null, null, true);
|
||||
expect(d.showBack).toEqual(true);
|
||||
|
||||
$ionicViewSwitcher.nextShowBack(false);
|
||||
var d = $ionicViewSwitcher.getTransitionData(null, null, null, null, true);
|
||||
expect(d.showBack).toEqual(false);
|
||||
|
||||
$ionicViewSwitcher.nextShowBack(true);
|
||||
d = $ionicViewSwitcher.getTransitionData(null, null, null, null, false);
|
||||
expect(d.showBack).toEqual(true);
|
||||
|
||||
$ionicViewSwitcher.nextShowBack(false);
|
||||
d = $ionicViewSwitcher.getTransitionData(null, null, null, null, false);
|
||||
expect(d.showBack).toEqual(false);
|
||||
|
||||
$ionicViewSwitcher.nextShowBack(true);
|
||||
d = $ionicViewSwitcher.getTransitionData(null, null, null, null, null);
|
||||
expect(d.showBack).toEqual(true);
|
||||
|
||||
$ionicViewSwitcher.nextShowBack(false);
|
||||
d = $ionicViewSwitcher.getTransitionData(null, null, null, null, null);
|
||||
expect(d.showBack).toEqual(false);
|
||||
|
||||
$ionicViewSwitcher.nextShowBack(null);
|
||||
d = $ionicViewSwitcher.getTransitionData(null, null, null, null, true);
|
||||
expect(d.showBack).toEqual(true);
|
||||
}));
|
||||
|
||||
it('should get an empty entering element with an empty navViewElement', inject(function($ionicViewSwitcher) {
|
||||
var navViewElement = angular.element('<div class="view-container">');
|
||||
var switcher = $ionicViewSwitcher.create(null, navViewElement, {}, {});
|
||||
|
||||
Reference in New Issue
Block a user