Make input and output tab areas scrollable

This commit is contained in:
j433866 2019-06-03 16:10:05 +01:00
parent f5cf7bb1f2
commit 2575a762e1
3 changed files with 37 additions and 3 deletions

View file

@ -51,7 +51,7 @@ class OutputWaiter {
* @returns {string | ArrayBuffer}
*/
getOutput(inputNum, raw=true) {
if (this.outputs[inputNum] === undefined || this.outputs[inputNum] === null) return -1;
if (!this.outputExists(inputNum)) return -1;
if (this.outputs[inputNum].data === null) return "";
@ -740,7 +740,7 @@ class OutputWaiter {
}
}
this.set(inputNum);
this.app.debounce(this.set, 50, "setOutput", this, [inputNum])();
if (changeInput) {
this.manager.input.changeTab(inputNum, false);
@ -760,6 +760,22 @@ class OutputWaiter {
}
}
/**
* Handler for scrolling on the output tabs area
*
* @param {event} wheelEvent
*/
scrollTab(wheelEvent) {
wheelEvent.preventDefault();
if (wheelEvent.deltaY > 0) {
this.changeTabLeft();
} else if (wheelEvent.deltaY < 0) {
this.changeTabRight();
}
}
/**
* Handler for changing to the left tab
*/