fix(popup): if popup is taller than the window, shrink the popup body and make it scrollable. Closes #1679

This commit is contained in:
Perry Govier
2014-06-27 11:27:06 -05:00
parent f4043e673c
commit 3e6ce1831b
4 changed files with 38 additions and 0 deletions

View File

@@ -108,6 +108,18 @@ describe('$ionicPopup service', function() {
expect(popup.element.hasClass('active')).toBe(false);
ionic.requestAnimationFrame = function(cb) { cb(); };
});
it('should shrink .popup-body height so that the popup is never taller than the window', function() {
str = 'All work and no play... ';
for(var i=0; i<13;i++){
str = str + str;
}
var popup = TestUtil.unwrapPromise($ionicPopup._createPopup({
template: str
}));
popup.show();
var windowIsLarger = popup.element[0].offsetHeight < window.innerHeight;
expect(windowIsLarger).toBe(true);
});
});
describe('hide', function() {