mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-20 20:33:32 +08:00
chore(): change source code console.log to console.debug
This commit is contained in:
@ -353,7 +353,7 @@ export class InputBase {
|
|||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
clearTextInput() {
|
clearTextInput() {
|
||||||
console.log("Should clear input");
|
console.debug("Should clear input");
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -66,9 +66,9 @@ export class List extends Ion {
|
|||||||
*/
|
*/
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
if (isDefined(this.virtual)) {
|
if (isDefined(this.virtual)) {
|
||||||
console.log('Content', this.content);
|
console.debug('Content', this.content);
|
||||||
console.log('Virtual?', this.virtual);
|
console.debug('Virtual?', this.virtual);
|
||||||
console.log('Items?', this.items.length, 'of \'em');
|
console.debug('Items?', this.items.length, 'of \'em');
|
||||||
this._initVirtualScrolling();
|
this._initVirtualScrolling();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -44,7 +44,7 @@ export class ListVirtualScroll {
|
|||||||
this.virtualHeight = this.list.items.length * this.itemHeight;
|
this.virtualHeight = this.list.items.length * this.itemHeight;
|
||||||
this.itemsPerScreen = this.viewportHeight / this.itemHeight;
|
this.itemsPerScreen = this.viewportHeight / this.itemHeight;
|
||||||
|
|
||||||
console.log('VIRTUAL: resize(viewportHeight:', this.viewportHeight,
|
console.debug('VIRTUAL: resize(viewportHeight:', this.viewportHeight,
|
||||||
'viewportScrollHeight:', this.viewportScrollHeight, 'virtualHeight:', this.virtualHeight,
|
'viewportScrollHeight:', this.viewportScrollHeight, 'virtualHeight:', this.virtualHeight,
|
||||||
', itemsPerScreen:', this.itemsPerScreen, ')');
|
', itemsPerScreen:', this.itemsPerScreen, ')');
|
||||||
}
|
}
|
||||||
@ -78,7 +78,7 @@ export class ListVirtualScroll {
|
|||||||
// virtual items we draw
|
// virtual items we draw
|
||||||
for (let i = topIndex, realIndex = 0; i < bottomIndex && i < items.length; i++, realIndex++) {
|
for (let i = topIndex, realIndex = 0; i < bottomIndex && i < items.length; i++, realIndex++) {
|
||||||
item = items[i];
|
item = items[i];
|
||||||
console.log('Drawing item', i, item.title);
|
console.debug('Drawing item', i, item.title);
|
||||||
|
|
||||||
shownItemRef = this.shownItems[i];
|
shownItemRef = this.shownItems[i];
|
||||||
|
|
||||||
@ -100,12 +100,12 @@ export class ListVirtualScroll {
|
|||||||
|
|
||||||
while (this.leavingItems.length) {
|
while (this.leavingItems.length) {
|
||||||
let itemRef = this.leavingItems.pop();
|
let itemRef = this.leavingItems.pop();
|
||||||
console.log('Removing item', itemRef.item, itemRef.realIndex);
|
console.debug('Removing item', itemRef.item, itemRef.realIndex);
|
||||||
this.viewContainer.remove(itemRef.realIndex);
|
this.viewContainer.remove(itemRef.realIndex);
|
||||||
}
|
}
|
||||||
|
|
||||||
console.log('VIRTUAL SCROLL: scroll(scrollTop:', st, 'topIndex:', topIndex, 'bottomIndex:', bottomIndex, ')');
|
console.debug('VIRTUAL SCROLL: scroll(scrollTop:', st, 'topIndex:', topIndex, 'bottomIndex:', bottomIndex, ')');
|
||||||
console.log('Container has', this.list.getNativeElement().children.length, 'children');
|
console.debug('Container has', this.list.getNativeElement().children.length, 'children');
|
||||||
}
|
}
|
||||||
|
|
||||||
cellAtIndex(index) {
|
cellAtIndex(index) {
|
||||||
|
@ -31,20 +31,20 @@ import {raf, ready, CSS} from '../../util/dom';
|
|||||||
* export class MyClass {
|
* export class MyClass {
|
||||||
* constructor(){}
|
* constructor(){}
|
||||||
* doRefresh(refresher) {
|
* doRefresh(refresher) {
|
||||||
* console.log('Refreshing!', refresher);
|
* console.debug('Refreshing!', refresher);
|
||||||
*
|
*
|
||||||
* setTimeout(() => {
|
* setTimeout(() => {
|
||||||
* console.log('Pull to refresh complete!', refresher);
|
* console.debug('Pull to refresh complete!', refresher);
|
||||||
* refresher.complete();
|
* refresher.complete();
|
||||||
* })
|
* })
|
||||||
* }
|
* }
|
||||||
*
|
*
|
||||||
* doStarting() {
|
* doStarting() {
|
||||||
* console.log('Pull started!');
|
* console.debug('Pull started!');
|
||||||
* }
|
* }
|
||||||
*
|
*
|
||||||
* doPulling(amt) {
|
* doPulling(amt) {
|
||||||
* console.log('You have pulled', amt);
|
* console.debug('You have pulled', amt);
|
||||||
* }
|
* }
|
||||||
* }
|
* }
|
||||||
* ```
|
* ```
|
||||||
@ -441,7 +441,7 @@ export class Refresher {
|
|||||||
* @param {Event} e TODO
|
* @param {Event} e TODO
|
||||||
*/
|
*/
|
||||||
_handleTouchMove(e) {
|
_handleTouchMove(e) {
|
||||||
//console.log('TOUCHMOVE', e);
|
//console.debug('TOUCHMOVE', e);
|
||||||
|
|
||||||
// if multitouch or regular scroll event, get out immediately
|
// if multitouch or regular scroll event, get out immediately
|
||||||
if (!this.canOverscroll || e.touches.length > 1) {
|
if (!this.canOverscroll || e.touches.length > 1) {
|
||||||
@ -513,7 +513,7 @@ export class Refresher {
|
|||||||
* @param {Event} e TODO
|
* @param {Event} e TODO
|
||||||
*/
|
*/
|
||||||
_handleTouchEnd(e) {
|
_handleTouchEnd(e) {
|
||||||
console.log('TOUCHEND', e);
|
console.debug('TOUCHEND', e);
|
||||||
// if this wasn't an overscroll, get out immediately
|
// if this wasn't an overscroll, get out immediately
|
||||||
if (!this.canOverscroll && !this.isDragging) {
|
if (!this.canOverscroll && !this.isDragging) {
|
||||||
return;
|
return;
|
||||||
@ -548,6 +548,6 @@ export class Refresher {
|
|||||||
* @param {Event} e TODO
|
* @param {Event} e TODO
|
||||||
*/
|
*/
|
||||||
_handleScroll(e) {
|
_handleScroll(e) {
|
||||||
console.log('SCROLL', e.target.scrollTop);
|
console.debug('SCROLL', e.target.scrollTop);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -378,12 +378,12 @@ export class Slides extends Ion {
|
|||||||
|
|
||||||
this.zoomGesture.on('pinchstart', (e) => {
|
this.zoomGesture.on('pinchstart', (e) => {
|
||||||
last_scale = this.scale;
|
last_scale = this.scale;
|
||||||
console.log('Last scale', e.scale);
|
console.debug('Last scale', e.scale);
|
||||||
});
|
});
|
||||||
|
|
||||||
this.zoomGesture.on('pinch', (e) => {
|
this.zoomGesture.on('pinch', (e) => {
|
||||||
this.scale = Math.max(1, Math.min(last_scale * e.scale, 10));
|
this.scale = Math.max(1, Math.min(last_scale * e.scale, 10));
|
||||||
console.log('Scaling', this.scale);
|
console.debug('Scaling', this.scale);
|
||||||
this.zoomElement.style[CSS.transform] = 'scale(' + this.scale + ')'
|
this.zoomElement.style[CSS.transform] = 'scale(' + this.scale + ')'
|
||||||
|
|
||||||
zoomRect = this.zoomElement.getBoundingClientRect();
|
zoomRect = this.zoomElement.getBoundingClientRect();
|
||||||
@ -424,10 +424,10 @@ export class Slides extends Ion {
|
|||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
toggleZoom(swiper, e) {
|
toggleZoom(swiper, e) {
|
||||||
console.log('Try toggle zoom');
|
console.debug('Try toggle zoom');
|
||||||
if (!this.enableZoom) { return; }
|
if (!this.enableZoom) { return; }
|
||||||
|
|
||||||
console.log('Toggling zoom', e);
|
console.debug('Toggling zoom', e);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
let x = e.pointers[0].clientX;
|
let x = e.pointers[0].clientX;
|
||||||
@ -451,7 +451,7 @@ export class Slides extends Ion {
|
|||||||
ty = y-my;
|
ty = y-my;
|
||||||
}
|
}
|
||||||
|
|
||||||
console.log(y);
|
console.debug(y);
|
||||||
*/
|
*/
|
||||||
|
|
||||||
let zi = new Animation(this.touch.target.children[0])
|
let zi = new Animation(this.touch.target.children[0])
|
||||||
@ -512,7 +512,7 @@ export class Slides extends Ion {
|
|||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
onTouchStart(e) {
|
onTouchStart(e) {
|
||||||
console.log('Touch start', e);
|
console.debug('Touch start', e);
|
||||||
|
|
||||||
//TODO: Support mice as well
|
//TODO: Support mice as well
|
||||||
|
|
||||||
@ -532,7 +532,7 @@ export class Slides extends Ion {
|
|||||||
zoomableWidth: target.offsetWidth,
|
zoomableWidth: target.offsetWidth,
|
||||||
zoomableHeight: target.offsetHeight
|
zoomableHeight: target.offsetHeight
|
||||||
}
|
}
|
||||||
console.log('Target', this.touch.target);
|
console.debug('Target', this.touch.target);
|
||||||
|
|
||||||
//TODO: android prevent default
|
//TODO: android prevent default
|
||||||
|
|
||||||
@ -555,25 +555,25 @@ export class Slides extends Ion {
|
|||||||
let y1 = Math.min((this.viewportHeight / 2) - zoomableScaledHeight/2, 0)
|
let y1 = Math.min((this.viewportHeight / 2) - zoomableScaledHeight/2, 0)
|
||||||
let y2 = -y1;
|
let y2 = -y1;
|
||||||
|
|
||||||
console.log('BOUNDS', x1, x2, y1, y2);
|
console.debug('BOUNDS', x1, x2, y1, y2);
|
||||||
|
|
||||||
if (this.scale <= 1) {
|
if (this.scale <= 1) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
console.log('PAN', e);
|
console.debug('PAN', e);
|
||||||
|
|
||||||
// Move image
|
// Move image
|
||||||
this.touch.x = this.touch.deltaX + this.touch.lastX;
|
this.touch.x = this.touch.deltaX + this.touch.lastX;
|
||||||
this.touch.y = this.touch.deltaY + this.touch.lastY;
|
this.touch.y = this.touch.deltaY + this.touch.lastY;
|
||||||
|
|
||||||
console.log(this.touch.x, this.touch.y);
|
console.debug(this.touch.x, this.touch.y);
|
||||||
|
|
||||||
if (this.touch.x < x1) {
|
if (this.touch.x < x1) {
|
||||||
console.log('OUT ON LEFT');
|
console.debug('OUT ON LEFT');
|
||||||
}
|
}
|
||||||
if (this.touch.x > x2 ){
|
if (this.touch.x > x2 ){
|
||||||
console.log('OUT ON RIGHT');
|
console.debug('OUT ON RIGHT');
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.touch.x > this.viewportWidth) {
|
if (this.touch.x > this.viewportWidth) {
|
||||||
@ -581,7 +581,7 @@ export class Slides extends Ion {
|
|||||||
} else if (-this.touch.x > this.viewportWidth) {
|
} else if (-this.touch.x > this.viewportWidth) {
|
||||||
// Too far on the right side, let the event bubble up (to enable slider on edges, for example)
|
// Too far on the right side, let the event bubble up (to enable slider on edges, for example)
|
||||||
} else {
|
} else {
|
||||||
console.log('TRANSFORM', this.touch.x, this.touch.y, this.touch.target);
|
console.debug('TRANSFORM', this.touch.x, this.touch.y, this.touch.target);
|
||||||
//this.touch.target.style[CSS.transform] = 'translateX(' + this.touch.x + 'px) translateY(' + this.touch.y + 'px)';
|
//this.touch.target.style[CSS.transform] = 'translateX(' + this.touch.x + 'px) translateY(' + this.touch.y + 'px)';
|
||||||
this.touch.target.style[CSS.transform] = 'translateX(' + this.touch.x + 'px) translateY(' + this.touch.y + 'px)';
|
this.touch.target.style[CSS.transform] = 'translateX(' + this.touch.x + 'px) translateY(' + this.touch.y + 'px)';
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
@ -595,14 +595,14 @@ export class Slides extends Ion {
|
|||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
onTouchEnd(e) {
|
onTouchEnd(e) {
|
||||||
console.log('PANEND', e);
|
console.debug('PANEND', e);
|
||||||
|
|
||||||
if (this.scale > 1) {
|
if (this.scale > 1) {
|
||||||
|
|
||||||
if (Math.abs(this.touch.x) > this.viewportWidth) {
|
if (Math.abs(this.touch.x) > this.viewportWidth) {
|
||||||
// TODO what is posX?
|
// TODO what is posX?
|
||||||
var posX = posX > 0 ? this.viewportWidth - 1 : -(this.viewportWidth - 1);
|
var posX = posX > 0 ? this.viewportWidth - 1 : -(this.viewportWidth - 1);
|
||||||
console.log('Setting on posx', this.touch.x);
|
console.debug('Setting on posx', this.touch.x);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
Reference in New Issue
Block a user