mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2026-03-13 10:22:08 +08:00
fix(ionContent): make scrollable content work as child of non-scrollable
Closes #1421
This commit is contained in:
3
js/angular/directive/content.js
vendored
3
js/angular/directive/content.js
vendored
@@ -79,7 +79,6 @@ function($timeout, $controller, $ionicBind) {
|
||||
$onScroll: '&onScroll',
|
||||
$onScrollComplete: '&onScrollComplete',
|
||||
hasBouncing: '@',
|
||||
scroll: '@',
|
||||
padding: '@',
|
||||
hasScrollX: '@',
|
||||
hasScrollY: '@',
|
||||
@@ -96,7 +95,7 @@ function($timeout, $controller, $ionicBind) {
|
||||
});
|
||||
}
|
||||
|
||||
if ($scope.scroll === "false") {
|
||||
if ($attr.scroll === "false") {
|
||||
//do nothing
|
||||
} else if(attr.overflowScroll === "true") {
|
||||
$element.addClass('overflow-scroll');
|
||||
|
||||
@@ -75,6 +75,20 @@ describe('Ionic Content directive', function() {
|
||||
expect(scroll.length).toBe(0);
|
||||
});
|
||||
|
||||
it('should work scrollable with nested ionScroll elements', function() {
|
||||
var element = compile(
|
||||
'<ion-content scroll="false" class="content1">' +
|
||||
'<div>' +
|
||||
'<ion-content class="content2">' +
|
||||
'</ion-content>' +
|
||||
'</div>' +
|
||||
'</ion-content>')(scope);
|
||||
scope.$apply();
|
||||
|
||||
expect(jqLite(element[0].querySelector('.content2')).controller('$ionicScroll')).toBeTruthy();
|
||||
expect(element.controller('$ionicScroll')).toBeFalsy();
|
||||
});
|
||||
|
||||
it('should add padding classname to scroll element', function() {
|
||||
var element = compile('<ion-content padding="shouldPad"></ion-content>')(scope);
|
||||
var scroll = element.find('.scroll');
|
||||
|
||||
Reference in New Issue
Block a user