mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2026-03-13 10:22:08 +08:00
fix(list): css: don't make last .list on page have margin-bottom
Addresses #425
This commit is contained in:
@@ -592,9 +592,9 @@ ionic.views.Scroll = ionic.views.View.inherit({
|
||||
|
||||
// Event Handler
|
||||
var container = this.__container;
|
||||
|
||||
|
||||
if ('ontouchstart' in window) {
|
||||
|
||||
|
||||
container.addEventListener("touchstart", function(e) {
|
||||
if (e.__scroller) {
|
||||
return;
|
||||
@@ -603,7 +603,7 @@ ionic.views.Scroll = ionic.views.View.inherit({
|
||||
if (e.target.tagName.match(/input|textarea|select/i)) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
self.doTouchStart(e.touches, e.timeStamp);
|
||||
e.preventDefault();
|
||||
//We don't want to stop propagation, other things might want to know about the touchstart
|
||||
@@ -620,9 +620,9 @@ ionic.views.Scroll = ionic.views.View.inherit({
|
||||
document.addEventListener("touchend", function(e) {
|
||||
self.doTouchEnd(e.timeStamp);
|
||||
}, false);
|
||||
|
||||
|
||||
} else {
|
||||
|
||||
|
||||
var mousedown = false;
|
||||
|
||||
container.addEventListener("mousedown", function(e) {
|
||||
@@ -633,7 +633,7 @@ ionic.views.Scroll = ionic.views.View.inherit({
|
||||
if (e.target.tagName.match(/input|textarea|select/i)) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
self.doTouchStart([{
|
||||
pageX: e.pageX,
|
||||
pageY: e.pageY
|
||||
@@ -666,7 +666,7 @@ ionic.views.Scroll = ionic.views.View.inherit({
|
||||
|
||||
mousedown = false;
|
||||
}, false);
|
||||
|
||||
|
||||
}
|
||||
},
|
||||
|
||||
@@ -881,7 +881,8 @@ ionic.views.Scroll = ionic.views.View.inherit({
|
||||
this.__container.clientWidth,
|
||||
this.__container.clientHeight,
|
||||
Math.max(this.__content.scrollWidth, this.__content.offsetWidth),
|
||||
Math.max(this.__content.scrollHeight, this.__content.offsetHeight+20));
|
||||
Math.max(this.__content.scrollHeight, this.__content.offsetHeight)
|
||||
);
|
||||
},
|
||||
/*
|
||||
---------------------------------------------------------------------------
|
||||
@@ -904,14 +905,14 @@ ionic.views.Scroll = ionic.views.View.inherit({
|
||||
} else if (typeof navigator.cpuClass === 'string') {
|
||||
engine = 'trident';
|
||||
}
|
||||
|
||||
|
||||
var vendorPrefix = {
|
||||
trident: 'ms',
|
||||
gecko: 'Moz',
|
||||
webkit: 'Webkit',
|
||||
presto: 'O'
|
||||
}[engine];
|
||||
|
||||
|
||||
var helperElem = document.createElement("div");
|
||||
var undef;
|
||||
|
||||
@@ -922,25 +923,25 @@ ionic.views.Scroll = ionic.views.View.inherit({
|
||||
self.__perspectiveProperty = transformProperty;
|
||||
self.__transformProperty = transformProperty;
|
||||
self.__transformOriginProperty = transformOriginProperty;
|
||||
|
||||
|
||||
if (helperElem.style[perspectiveProperty] !== undef) {
|
||||
|
||||
|
||||
return function(left, top, zoom) {
|
||||
content.style[transformProperty] = 'translate3d(' + (-left) + 'px,' + (-top) + 'px,0)';
|
||||
self.__repositionScrollbars();
|
||||
self.triggerScrollEvent();
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
} else if (helperElem.style[transformProperty] !== undef) {
|
||||
|
||||
|
||||
return function(left, top, zoom) {
|
||||
content.style[transformProperty] = 'translate(' + (-left) + 'px,' + (-top) + 'px)';
|
||||
self.__repositionScrollbars();
|
||||
self.triggerScrollEvent();
|
||||
};
|
||||
|
||||
|
||||
} else {
|
||||
|
||||
|
||||
return function(left, top, zoom) {
|
||||
content.style.marginLeft = left ? (-left/zoom) + 'px' : '';
|
||||
content.style.marginTop = top ? (-top/zoom) + 'px' : '';
|
||||
@@ -948,7 +949,7 @@ ionic.views.Scroll = ionic.views.View.inherit({
|
||||
self.__repositionScrollbars();
|
||||
self.triggerScrollEvent();
|
||||
};
|
||||
|
||||
|
||||
}
|
||||
},
|
||||
|
||||
@@ -1838,7 +1839,7 @@ ionic.views.Scroll = ionic.views.View.inherit({
|
||||
|
||||
var sizer = function() {
|
||||
self.resize();
|
||||
|
||||
|
||||
if((self.options.scrollingX && self.__maxScrollLeft == 0) || (self.options.scrollingY && self.__maxScrollTop == 0)) {
|
||||
//self.__sizerTimeout = setTimeout(sizer, 1000);
|
||||
}
|
||||
@@ -2005,8 +2006,8 @@ ionic.views.Scroll = ionic.views.View.inherit({
|
||||
var scrollOutsideY = 0;
|
||||
|
||||
// This configures the amount of change applied to deceleration/acceleration when reaching boundaries
|
||||
var penetrationDeceleration = self.options.penetrationDeceleration;
|
||||
var penetrationAcceleration = self.options.penetrationAcceleration;
|
||||
var penetrationDeceleration = self.options.penetrationDeceleration;
|
||||
var penetrationAcceleration = self.options.penetrationAcceleration;
|
||||
|
||||
// Check limits
|
||||
if (scrollLeft < self.__minDecelerationScrollLeft) {
|
||||
|
||||
@@ -6,10 +6,14 @@
|
||||
|
||||
.list {
|
||||
position: relative;
|
||||
margin-bottom: 20px;
|
||||
padding-top: $item-border-width;
|
||||
padding-bottom: $item-border-width;
|
||||
padding-left: 0; // reset padding because ul and ol
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
/* If a list is the last item in a container, don't add margin-bottom */
|
||||
.list:last-child {
|
||||
margin-bottom: 0px;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -57,7 +61,7 @@
|
||||
* A card and list-inset are close to the same thing, except a card as a box shadow.
|
||||
*/
|
||||
|
||||
.card,
|
||||
.card,
|
||||
.list-inset {
|
||||
overflow: hidden;
|
||||
margin: ($content-padding * 2) $content-padding;
|
||||
@@ -95,7 +99,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
.card .item:last-child,
|
||||
.card .item:last-child,
|
||||
.list-inset .item:last-child {
|
||||
margin-bottom: $item-border-width * -1;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user