mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2026-03-13 10:22:08 +08:00
fix .padding for .scroll
This commit is contained in:
20
dist/js/ionic-angular.js
vendored
20
dist/js/ionic-angular.js
vendored
@@ -658,16 +658,10 @@ angular.module('ionic.ui.content', [])
|
||||
return function($scope, $element, $attr) {
|
||||
var
|
||||
c = $element.eq(0),
|
||||
scroll = $element[0].querySelector('.scroll'),
|
||||
clone,
|
||||
sc,
|
||||
sv;
|
||||
|
||||
if(scroll && attr.padding == "true") {
|
||||
scroll.classList.add('padding');
|
||||
} else if(attr.padding == "true") {
|
||||
c.addClass('padding');
|
||||
}
|
||||
sv,
|
||||
addedPadding = false;
|
||||
|
||||
if(attr.hasHeader == "true") {
|
||||
c.addClass('has-header');
|
||||
@@ -702,6 +696,10 @@ angular.module('ionic.ui.content', [])
|
||||
} else {
|
||||
sc = document.createElement('div');
|
||||
sc.className = 'scroll';
|
||||
if(attr.padding == "true") {
|
||||
sc.className += ' padding';
|
||||
addedPadding = true;
|
||||
}
|
||||
$element.append(sc);
|
||||
// Otherwise, supercharge this baby!
|
||||
sv = new ionic.views.Scroll({
|
||||
@@ -723,6 +721,12 @@ angular.module('ionic.ui.content', [])
|
||||
clone = transclude($scope.$parent);
|
||||
angular.element($element[0].firstElementChild).append(clone);
|
||||
}
|
||||
|
||||
// if padding attribute is true, then add padding if it wasn't added to the .scroll
|
||||
if(attr.padding == "true" && !addedPadding) {
|
||||
c.addClass('padding');
|
||||
}
|
||||
|
||||
};
|
||||
}
|
||||
};
|
||||
|
||||
6
dist/js/ionic.js
vendored
6
dist/js/ionic.js
vendored
@@ -3232,7 +3232,7 @@ window.ionic = {
|
||||
ionic.extend(this, opts);
|
||||
|
||||
if(!this.itemHeight && this.listEl) {
|
||||
this.itemHeight = this.listEl.children[0] && parseInt(this.listEl.children[0].style.height);
|
||||
this.itemHeight = this.listEl.children[0] && parseInt(this.listEl.children[0].style.height, 10);
|
||||
}
|
||||
|
||||
ionic.views.ListView.__super__.initialize.call(this, opts);
|
||||
@@ -3294,8 +3294,8 @@ window.ionic = {
|
||||
|
||||
// Get the first and last elements in the list based on how many can fit
|
||||
// between the pixel range of lowWater and highWater
|
||||
var first = parseInt(Math.abs(highWater / itemHeight));
|
||||
var last = parseInt(Math.abs(lowWater / itemHeight));
|
||||
var first = parseInt(Math.abs(highWater / itemHeight), 10);
|
||||
var last = parseInt(Math.abs(lowWater / itemHeight), 10);
|
||||
|
||||
// Get the items we need to remove
|
||||
this._virtualItemsToRemove = Array.prototype.slice.call(this.listEl.children, 0, first);
|
||||
|
||||
20
js/ext/angular/src/directive/ionicContent.js
vendored
20
js/ext/angular/src/directive/ionicContent.js
vendored
@@ -34,16 +34,10 @@ angular.module('ionic.ui.content', [])
|
||||
return function($scope, $element, $attr) {
|
||||
var
|
||||
c = $element.eq(0),
|
||||
scroll = $element[0].querySelector('.scroll'),
|
||||
clone,
|
||||
sc,
|
||||
sv;
|
||||
|
||||
if(scroll && attr.padding == "true") {
|
||||
scroll.classList.add('padding');
|
||||
} else if(attr.padding == "true") {
|
||||
c.addClass('padding');
|
||||
}
|
||||
sv,
|
||||
addedPadding = false;
|
||||
|
||||
if(attr.hasHeader == "true") {
|
||||
c.addClass('has-header');
|
||||
@@ -78,6 +72,10 @@ angular.module('ionic.ui.content', [])
|
||||
} else {
|
||||
sc = document.createElement('div');
|
||||
sc.className = 'scroll';
|
||||
if(attr.padding == "true") {
|
||||
sc.className += ' padding';
|
||||
addedPadding = true;
|
||||
}
|
||||
$element.append(sc);
|
||||
// Otherwise, supercharge this baby!
|
||||
sv = new ionic.views.Scroll({
|
||||
@@ -99,6 +97,12 @@ angular.module('ionic.ui.content', [])
|
||||
clone = transclude($scope.$parent);
|
||||
angular.element($element[0].firstElementChild).append(clone);
|
||||
}
|
||||
|
||||
// if padding attribute is true, then add padding if it wasn't added to the .scroll
|
||||
if(attr.padding == "true" && !addedPadding) {
|
||||
c.addClass('padding');
|
||||
}
|
||||
|
||||
};
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user