Merge branch 'master' into 751-IE11-demo
This commit is contained in:
@@ -13,6 +13,7 @@ export class Viewport {
|
|||||||
private currentRowHeight: number;
|
private currentRowHeight: number;
|
||||||
private lastRecordedBufferLength: number;
|
private lastRecordedBufferLength: number;
|
||||||
private lastRecordedViewportHeight: number;
|
private lastRecordedViewportHeight: number;
|
||||||
|
private lastTouchY: number;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates a new Viewport.
|
* Creates a new Viewport.
|
||||||
@@ -121,4 +122,26 @@ export class Viewport {
|
|||||||
// Prevent the page from scrolling when the terminal scrolls
|
// Prevent the page from scrolling when the terminal scrolls
|
||||||
ev.preventDefault();
|
ev.preventDefault();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Handles the touchstart event, recording the touch occurred.
|
||||||
|
* @param ev The touch event.
|
||||||
|
*/
|
||||||
|
public onTouchStart(ev: TouchEvent) {
|
||||||
|
this.lastTouchY = ev.touches[0].pageY;
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Handles the touchmove event, scrolling the viewport if the position shifted.
|
||||||
|
* @param ev The touch event.
|
||||||
|
*/
|
||||||
|
public onTouchMove(ev: TouchEvent) {
|
||||||
|
let deltaY = this.lastTouchY - ev.touches[0].pageY;
|
||||||
|
this.lastTouchY = ev.touches[0].pageY;
|
||||||
|
if (deltaY === 0) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
this.viewportElement.scrollTop += deltaY;
|
||||||
|
ev.preventDefault();
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1095,6 +1095,18 @@ Terminal.prototype.bindMouse = function() {
|
|||||||
self.viewport.onWheel(ev);
|
self.viewport.onWheel(ev);
|
||||||
return self.cancel(ev);
|
return self.cancel(ev);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
on(el, 'touchstart', function(ev) {
|
||||||
|
if (self.mouseEvents) return;
|
||||||
|
self.viewport.onTouchStart(ev);
|
||||||
|
return self.cancel(ev);
|
||||||
|
});
|
||||||
|
|
||||||
|
on(el, 'touchmove', function(ev) {
|
||||||
|
if (self.mouseEvents) return;
|
||||||
|
self.viewport.onTouchMove(ev);
|
||||||
|
return self.cancel(ev);
|
||||||
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -1915,6 +1927,10 @@ Terminal.prototype.resize = function(x, y) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (y > this.getOption('scrollback')) {
|
||||||
|
this.setOption('scrollback', y)
|
||||||
|
}
|
||||||
|
|
||||||
var line
|
var line
|
||||||
, el
|
, el
|
||||||
, i
|
, i
|
||||||
|
|||||||
Reference in New Issue
Block a user