mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2026-03-13 10:22:08 +08:00
feat($ionicBody): service to simplify body ele interaction
Many services/directives have to interact with the body element, and each one has to write the same long code. The $ionicBody service provides some useful methods to clean up and reduce redundant code.
This commit is contained in:
@@ -84,6 +84,14 @@ describe('$ionicSideMenus controller', function() {
|
||||
expect(ctrl.getOpenPercentage()).toEqual(-50);
|
||||
});
|
||||
|
||||
it('should add/remove menu-open from the body class', inject(function($document) {
|
||||
expect($document[0].body.classList.contains('menu-open')).toEqual(false);
|
||||
ctrl.openPercentage(100);
|
||||
expect($document[0].body.classList.contains('menu-open')).toEqual(true);
|
||||
ctrl.openPercentage(0);
|
||||
expect($document[0].body.classList.contains('menu-open')).toEqual(false);
|
||||
}));
|
||||
|
||||
// Open
|
||||
it('should toggle left', function() {
|
||||
ctrl.toggleLeft();
|
||||
|
||||
Reference in New Issue
Block a user