Holding down on tab change buttons will scroll.

Hide loading stats when there's only one input
This commit is contained in:
j433866 2019-06-04 11:42:27 +01:00
parent 15b5cf7c20
commit 99e9df0211
3 changed files with 99 additions and 9 deletions

View file

@ -898,7 +898,13 @@ class InputWaiter {
msg += "<br>loading: " + loadingStr;
}
document.getElementById("input-files-info").innerHTML = msg;
const inFiles = document.getElementById("input-files-info");
if (total > 1) {
inFiles.innerHTML = msg;
inFiles.style.display = "";
} else {
inFiles.style.display = "none";
}
this.updateFileProgress(loadedData.activeProgress.inputNum, loadedData.activeProgress.progress);
@ -1238,8 +1244,8 @@ class InputWaiter {
*/
inputAdded(changeTab, inputNum) {
this.addTab(inputNum, changeTab);
this.manager.output.addOutput(inputNum, changeTab);
this.manager.output.addOutput(inputNum, changeTab);
this.manager.worker.addChefWorker();
}
@ -1345,11 +1351,51 @@ class InputWaiter {
} else if (wheelEvent.deltaY < 0) {
this.changeTabRight();
}
}
/**
* Handler for clicking on next tab button
* Handler for mouse down on the next tab button
*/
nextTabClick() {
this.mousedown = true;
this.changeTabRight();
const time = 200;
const func = function(time) {
if (this.mousedown) {
this.changeTabRight();
const newTime = (time > 50) ? time = time - 10 : 50;
setTimeout(func.bind(this, [newTime]), newTime);
}
};
setTimeout(func.bind(this, [time]), time);
}
/**
* Handler for mouse down on the previous tab button
*/
previousTabClick() {
this.mousedown = true;
this.changeTabLeft();
const time = 200;
const func = function(time) {
if (this.mousedown) {
this.changeTabLeft();
const newTime = (time > 50) ? time = time - 10 : 50;
setTimeout(func.bind(this, [newTime]), newTime);
}
};
setTimeout(func.bind(this, [time]), time);
}
/**
* Handler for mouse up event on the tab buttons
*/
tabMouseUp() {
this.mousedown = false;
}
/**
* Changes to the next (right) tab
*/
changeTabRight() {
const activeTab = this.getActiveTab();
@ -1363,7 +1409,7 @@ class InputWaiter {
}
/**
* Handler for clicking on previous tab button
* Changes to the previous (left) tab
*/
changeTabLeft() {
const activeTab = this.getActiveTab();